RE: [PHP-DB] MSSQL DateTime field formatting?

From: Date: Tue, 14 May 2002 21:03:51 +0000
Subject: RE: [PHP-DB] MSSQL DateTime field formatting?
Groups: php.db 
Request: Send a blank email to php-db+get-19186@lists.php.net to get a copy of this message
This is how I do it: date("m/d/Y",strtotime(odbc_result($rs,"ts"))) where $rs is the result set and "ts" is the name of the field containing the datetime. <>< Ryan -----Original Message----- From: Benjamin Walling [mailto:bwalling@edentaldirect.com] Sent: Tuesday, May 14, 2002 2:59 PM To: php-db@lists.php.net Subject: [PHP-DB] MSSQL DateTime field formatting? I can't seem to find a way to format the field that comes back from my DateTime fields in MSSQL Server. For example, '2002-05-13' shows in Query Analyzer as 2002-05-13 00:00:00.000. If I echo it from PHP, I get May 13 2002 12:00AM. date() won't take it. strftime() won't take it. What do I need to do to convert this to a time PHP likes? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.db (#19186) next »