Re: MS SQL date time strangeness

From: Date: Mon, 26 Jan 2004 23:55:24 +0000
Subject: Re: MS SQL date time strangeness
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-32633@lists.php.net to get a copy of this message
The date() is for use with the 32-bit C time value returned by functions like time(). Data from fields of type datetime are returned as strings in the form Jan 9 2004 by the mssql extension as the default. To return it using ISO format set mssql.datetimeconvert to "On" in the php.ini file, or use the following command: ini_set('mssql.datetimeconvert' , 1 ); -- bob On Mon, 26 Jan 2004, Steve wrote: > I have Apache 1.3 and PHP 4 running on Windows 98 connecting to a local > MS SQL 7.0 server. MS SQL has the date as 2004-01-09 (YYYY-MM-DD), when > I print the date to a webpage with this PHP code: > > printf("Date Picked Up: %s\nDate", date("Y/j/n",$row[0]); > > I get this output: > > 1969/12/31 > > What is wrong? > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.db (#32633) next »