Page 1 of 1
un-sure how to convert this
Posted: Wed Jun 11, 2003 2:03 am
by Sevengraff
I have a bunch of records that use the MySQL date field (YYYY-MM-DD). I need to change this into a standard UNIX timestamp, because I'm trying to convert old entries from my old script into the new one. Is there a way to do this?
Posted: Wed Jun 11, 2003 2:26 am
by cactus
Do you want the database entires to have a timet ?
If not, convert it when you get it out of the database, else you will need to write a script to loop through the database and convert the old format to the new, ensuring that you use "update" in your SQL.
Regards,
Posted: Wed Jun 11, 2003 3:09 am
by twigletmac
You can use MySQL time and date functions to manipulate the info:
http://www.mysql.com/doc/en/Date_and_ti ... tions.html
(check out UNIX_TIMESTAMP())
Mac
Posted: Wed Jun 11, 2003 10:23 pm
by Sevengraff
UNIX_TIMESTAMP() worked perfectly. Thanks a bunch!