Re: PHP, MySQL and datetime

From: Date: Fri, 05 Dec 2003 03:40:33 +0000
Subject: Re: PHP, MySQL and datetime
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-171940@lists.php.net to get a copy of this message
Nope, that's what I was looking for. Looking at the functions I realized there was more than one way to do it. I'm just a bandwagon jumper. And yes, if all of you jumped off a cliff I would to. --- Richard Davey <rich@launchcode.co.uk> wrote: > Hello Jough, > > Thursday, December 4, 2003, 6:39:13 PM, you wrote: > > JJ> Greetings all, I'm working on a > message-board-type > JJ> application that will use time stamps to sort > part of the > JJ> messages. I was wondering what everyone's > favorite way to > JJ> transfer dates between PHP and MySQL was? > > Seeing as MySQL will only take them in one standard > format you have to > adhere to that ('YYYY-MM-DD HH:MM:SS'). All the > MySQL date operations > work on this format, so keep to it. When you pass > from PHP to MySQL, > make sure it's in that format (easy to do with the > date() function). > If you need to convert more esoteric formats, or do > date handling from > within PHP before sending to MySQL then use the > strtotime function > combined with the date(). > > Unless you meant something else of course? :) > > -- > Best regards, > Richard > mailto:rich@launchcode.co.uk > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > __________________________________ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/

« previous php.general (#171940) next »