From:             krister dot karlstrom at arcada dot fi
Operating system: Ubuntu
PHP version:      5.2.5
PHP Bug Type:     Feature/Change Request
Bug description:  support for new format of milliseconds in strtotime()

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 

-- 
Edit bug report at http://bugs.php.net/?id=44426&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=44426&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=44426&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=44426&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=44426&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=44426&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=44426&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=44426&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=44426&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=44426&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=44426&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=44426&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=44426&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=44426&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=44426&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=44426&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=44426&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=44426&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=44426&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=44426&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=44426&r=mysqlcfg

Reply via email to