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

From: Date: Wed, 05 Dec 2018 13:40:25 +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-218279@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:         christophe at gosiau dot be
 Reported by:        jmf at durcommefaire dot net
 Summary:            DateTime does not handle decimal fractions of ISO
                     8601 format
 Status:             Not a bug
 Type:               Bug
 Package:            Date/time related
 Operating System:   Ubuntu 10.04
 PHP Version:        5.3.2
 Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

I would like to refer to this Wikipedia article:
https://en.wikipedia.org/wiki/ISO_8601

It states:
A decimal mark, either a comma or a dot (without any preference as stated in resolution 10 of the
22nd General Conference CGPM in 2003,[14] but with a preference for a comma according to ISO
8601:2004)[15] is used as a separator between the time element and its fraction.


Previous Comments:
------------------------------------------------------------------------
[2016-08-07 14:51:18] cmb@php.net

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php

DateTime::ISO8601 is defined to "Y-m-d\TH:i:sO"[1], so obviously
it doesn't accept microsecond fractions. If you expect these to be
given, use another format specifier, see <https://3v4l.org/ADn0l>.

If you want to accept different ISO-8601 date/time formats,
don't use date_create_from_format(), but rather date_create(),
see <https://3v4l.org/c879B>.

[1] <http://php.net/manual/en/class.datetime.php>

------------------------------------------------------------------------
[2015-12-01 09:28:51] seb at rootsandrain dot com

Still broken in PHP7:

https://3v4l.org/aKNVI

------------------------------------------------------------------------
[2015-06-25 05:05:02] broncha at rajesharma dot com

Confirmed on Mac. PHP version 5.5.26

------------------------------------------------------------------------
[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

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=51950


--
Edit this bug report at https://bugs.php.net/bug.php?id=51950&edit=1


Thread (12 messages)

« previous php.bugs (#218279) next »