Re: Date-format

From: Date: Wed, 18 Sep 2002 18:28:36 +0000
Subject: Re: Date-format
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-116780@lists.php.net to get a copy of this message
Reformatting before an inserting/updating is one option, but how would we change the mySQL database to accept the other format? Peter At 04:18 PM 9/12/2002 +0800, Jacob Miller wrote:
Why can't you just reformat it before inserting it into the db?
        $date = "31.12.2002";
        $parts = split("\.", $date);
        echo $parts[2]."-".$parts[1]."-".$parts[0];
- jacob At 16:13 09/12/2002, Tommi Virtanen wrote:
Well, insert format in wrong, but in Finland enter format is dd.mm.yyyy, so I cannot use other insert format (it have to do other way). gustavus
It looks to me like the database is interpreting your date incorrectly. Try changing the format you use to insert, yyyy-mm-dd
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- - - - - - - - - - - - - - - - - - - - - Fourth Realm Solutions pbechard@fourthrealm.com http://www.fourthrealm.com Tel: 519-739-1652 - - - - - - - - - - - - - - - - - - - - -

« previous php.general (#116780) next »