Req #69089 [NEW]: Add support for RFC3339 extended to DateTime::format

From: Date: Fri, 20 Feb 2015 12:34:15 +0000
Subject: Req #69089 [NEW]: Add support for RFC3339 extended to DateTime::format
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-190842@lists.php.net to get a copy of this message
From:             mariano at cricava dot com
Operating system: 
PHP version:      Irrelevant
Package:          Date/time related
Bug Type:         Feature/Change Request
Bug description:Add support for RFC3339 extended to DateTime::format

Description:
------------
Currently there's no built in format for outputting DateTime using RFC
3339 extended, which is used in several APIs. An output using such
format would look like:

2009-09-28T09:45:31.918-03:00

While PHP does have built in support for fraction of seconds in DateTime
(provided the DateTime was constructed with it) through its %u format
modifier, this modifier cannot be used for RFC 3339 extended as it is a
6 digit version of the fraction. Instead, a new format modifier is
needed (proposed %v, because of its proximity with %u) to output the
3-digit version of the fraction. To see the difference, for the fraction
918312 here's what would be output by both modifiers:

%u: 918312
%v: 918

A new constant should be added to DateTime (such as RFC3339_EXTENDED)
that would output strings in the RFC 3339 extended format, using this
new %v modifier.

A pull request with relevant tests lives here:

https://github.com/php/php-src/pull/1103


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



Thread (6 messages)

« previous php.bugs (#190842) next »