|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-03-13 10:27 UTC] johannes@php.net
[2008-03-13 15:54 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 21:00:01 2025 UTC |
Description: ------------ The default datestring format returned by MS-SQL 2000 through the MS-SQL support in PHP 5.2.3 (Ubuntu package) using the provided FreeTDS library contains milliseconds that are separated with a colon, not a dot. This breaks the parsing of the datestring in strtotime(), which only seems to allow milliseconds separated by a dot. For compatibility it would be great if strtotime() also could parse these strings. This is the format returned by MS-SQL 2000 from a datetime column: Aug 27 2007 12:00:00:000AM I hereby request that strtotime() should be able to parse this string, with our without the AM/PM (using 12 h or 24 h-format). For compatibility issues it would probably also be good if strtotime() could parse the string Aug 27 2007 12:00:00.000AM, since it for now doesn't allow the 12 h-format together with milliseconds. Reproduce code: --------------- echo "TIME: ".strtotime("Aug 27 2007 12:00:00:000AM"); echo "TIME: ".strtotime("Aug 27 2007 12:00:00.000AM"); echo "TIME: ".strtotime("Aug 27 2007 12:00:00:000"); echo "TIME: ".strtotime("Aug 27 2007 12:00:00.000"); echo "TIME: ".strtotime("Aug 27 2007 12:00:00AM"); echo "TIME: ".strtotime("Aug 27 2007"); echo "TIME: ".strtotime("Aug 27 2007 12:00AM"); Expected result: ---------------- TIME: 1188162000 TIME: 1188162000 TIME: 1188205200 TIME: 1188205200 TIME: 1188162000 TIME: 1188162000 TIME: 1188162000 Actual result: -------------- TIME: TIME: TIME: TIME: 1188205200 TIME: 1188162000 TIME: 1188162000 TIME: 1188162000