Hi everyone!
When I insert data into an SQL database that needs to be time stamped I like to use the "NOW()" function built into MySQL. This inserts information that looks like "2006-11-10 16:26:20" and while I enjoy using this on the database end, it isn't too readable when I'm displaying it.
When I grab the data from the database for displaying I would like to rewrite it to, for example, something like "November 10th, 2006 at 4:26"
How would I do this?
Rewriting date from MySQL
Moderator: General Moderators
You might find something useful in the documentation of the date and time functions of mysql, http://dev.mysql.com/doc/refman/5.0/en/ ... tions.html
Why don't you look at the date() function. If you pass it a timestamp, it will format the date information in anyway you want. Your only hurdle would be changing the date format you have to a timestamp. There may be a built in MySQL function that can do this or one of the other php date / time functions.
Cheers
Cheers