Bug #51950 [Com]: DateTime does not handle decimal fractions of ISO 8601 format

From: Date: Thu, 25 Jun 2015 05:05:04 +0000
Subject: Bug #51950 [Com]: DateTime does not handle decimal fractions of ISO 8601 format
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-193862@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=51950&edit=1

 ID:                 51950
 Comment by:         broncha at rajesharma dot com
 Reported by:        jmf at durcommefaire dot net
 Summary:            DateTime does not handle decimal fractions of ISO
                     8601 format
 Status:             Assigned
 Type:               Bug
 Package:            Date/time related
 Operating System:   Ubuntu 10.04
 PHP Version:        5.3.2
 Assigned To:        derick
 Block user comment: N
 Private report:     N

 New Comment:

Confirmed on Mac. PHP version 5.5.26


Previous Comments:
------------------------------------------------------------------------
[2014-11-12 23:48:40] dev at jonathanlidbeck dot com

This bug is present in PHP 5.5 for Windows.

------------------------------------------------------------------------
[2014-10-15 14:25:50] h dot kraal at tiw dot nl

This 4+ years old bug is still present in todays systems:
Ubuntu 10.04 / PHP 5.3.2-1ubuntu4.27
Ubuntu 12.04 / PHP 5.3.10-1ubuntu3.14
Ubuntu 14.04 / PHP 5.5.9-1ubuntu4.4

------------------------------------------------------------------------
[2010-05-30 19:56:13] jmf at durcommefaire dot net

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 this bug report at https://bugs.php.net/bug.php?id=51950&edit=1


Thread (12 messages)

« previous php.bugs (#193862) next »