I have a database that stores the time for me. I insert it from PHP using
date( \'Y-m-d H:i:s\');
I then use this function to convert it t
If you're using mysql, it has a DATE_FORMAT function. You can call it like
DATE_FORMAT
SELECT DATE_FORMAT(`datefield`, "%Y%m%d%H%i%s") AS `date_formatted` FROM table;
So you get an already formatted date from your database.