Hey I’ve been making a quiz on php and mysql…
I’ve used the CURRENT_TIMESTAMP to keep track of the time that users answer on specific questions. Now I would like to print out the time, and I’ve made a row in my database called ‘timestamp’.
It works perfectly to track which users answered first, but when i echo out the row, it looks like this:
2012-01-11 17:14:50
So my question is:
How do I break this up in time and date?
I can’t have 2 rows in my database for storing the time, cause as I said I use the CURRENT_TIMESTAMP to track which users answered first.
The way it’s printed out now isn’t very nice to look at, and it’s not very flexible to work with.
Hope anybody can help out,
Thanks alot for reading.
Mathias.
It sounds like you just want the datetime formatted in an aesthetically pleasing way. Check out this website: http://www.mysqlformatdate.com/ for all sorts of formats and find what you like best and add it to your select statement.