Re: MSSQL Date Format Problem

From: Date: Wed, 18 Sep 2002 01:15:03 +0000
Subject: Re: MSSQL Date Format Problem
References: 1 2  Groups: php.windows 
Request: Send a blank email to php-windows+get-15868@lists.php.net to get a copy of this message
this is personally why I try to always use iso compliant "yyyy-mm-dd hh:nn" or "yyyy-mm-dd" Matt Kynaston wrote: > ------=_NextPart_000_000D_01C25E30.61F93B80 > Content-Type: text/plain; > charset="iso-8859-1" > Content-Transfer-Encoding: 7bit > > 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 > > ------=_NextPart_000_000D_01C25E30.61F93B80-- -- ----------------------------------------------------------------------- Michael J. Ryan | ICQ: 4935386 tracker1(at)theroughnecks(dot)net | AIM/AOL: azTracker1 Roughneck BBS: | Yahoo: azTracker1 http://www.theroughnecks.net | MSN: (email address) telnet://theroughnecks.net | Trillian: www.trillian.cc --- Synchronet 3.10j-Win32 NewsLink 1.30 * Roughneck BBS - www.theroughnecks.net - telnet://theroughnecks.net

« previous php.windows (#15868) next »