Page 1 of 1
MySQL Date Problems
Posted: Wed Jul 30, 2008 4:06 pm
by tecktalkcm0391
MySQL Database wants a datetime input for one of its fields, but I don't know how to convert the time() method's output into this format. Any help?
PS. I add on time to the time returned by time().... so I can't just use NOW()
Re: MySQL Date Problems
Posted: Wed Jul 30, 2008 4:18 pm
by jaoudestudios
php time() is the unix time stamp and is the best date & time format to save, as it can easily be converted back to any date format. Real easy to do calculation and differences.
S0 you have a long number? What format do you want it in?
Some examples...
http://www.jaoudestudios.com/timestamp.php
Re: MySQL Date Problems
Posted: Sun Aug 03, 2008 2:29 pm
by pkbruker
Store the return value of time() in a BIGINT field in the database.