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()
MySQL Date Problems
Moderator: General Moderators
- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: MySQL Date Problems
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
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
Store the return value of time() in a BIGINT field in the database.