From:             
Operating system: Ubuntu 10.04
PHP version:      5.3.2
Package:          Date/time related
Bug Type:         Bug
Bug description:DateTime does not handle decimal fractions of ISO 8601 format

Description:
------------
DateTime does not handle decimal fractions of ISO 8601 format (cf.
http://en.wikipedia.org/wiki/ISO_8601#Times)



This value has decimal fraction and is not recognized by DateTime :



$dateTime = DateTime::createFromFormat(

    DateTime::ISO8601,

    '2009-04-16T12:07:23.596Z'

);

// bool(false)

var_dump($dateTime);





The same value without the decimal fraction is recognized :



$dateTime = DateTime::createFromFormat(

    DateTime::ISO8601,

    '2009-04-16T12:07:23Z'

);

// object(DateTime)#2 (3) { ["date"]=>  string(19) "2009-04-16 12:07:23"
["timezone_type"]=>  int(2) ["timezone"]=>  string(1) "Z" }

var_dump($dateTime);


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

Reply via email to