Re: [PHP4BETA] PHP4 + MSSQL + DATETIME datatype?

From: Date: Fri, 26 May 2000 22:53:24 +0000
Subject: Re: [PHP4BETA] PHP4 + MSSQL + DATETIME datatype?
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-15830@lists.php.net to get a copy of this message
"Ulrich, Eric J" wrote: > > I am have a weird problem pulling dates out of a SQL 7.0 database. > Here is the code: > > SELECT (SELECT MIN(LogTime) FROM wwwlog) AS 'BeginDate', (SELECT > MAX(LogTime) FROM wwwlog) AS 'EndDate' > > Nothing big! > here is the format I get: > Dec 24 1999 5:50PM which it is stored 12/24/1999 5:50:16 PM > if I try strftime("%m-%d-%Y %r" , Time) I get 12-31-1969 > If anyone can help great. > Thanks, > Eric Ulrich Perhaps you can get the format you want from the SQL server. Try using the CONVERT() function with the style option. I guess convert(char(20),time_field,100) will do the job. Andrian Andrian

« previous php.version4 (#15830) next »