RE: [PHP-WIN] MSSQL Date Format Problem

From: Date: Tue, 17 Sep 2002 08:55:39 +0000
Subject: RE: [PHP-WIN] MSSQL Date Format Problem
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-15857@lists.php.net to get a copy of this message
PHP is supposed to output the date according to the locale settings of the server - see setlocale() function to force the issue. But dates are always a pain - strtotime() and strftime() are your friends. > Incidentally, inserting a value into the databases on both > machines works > presenting the date as "14/9/2002", it is just when returning > a recordset to > PHP via the select statement that the difference occurs. Yikes! And what happens with "02/01/2002"? Remember: a yank build that DB. If it can, it probably will put months before days. _Always_ convert to YYYYMMDD before inserting, otherwise terrible things start happening on November the nineth. Matt

« previous php.windows (#15857) next »