Bug #55272 [NEW]: Missing semicolon in DATE_ISO8601 Predefined Constant for date()

From: Date: Sat, 23 Jul 2011 20:39:42 +0000
Subject: Bug #55272 [NEW]: Missing semicolon in DATE_ISO8601 Predefined Constant for date()
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-162138@lists.php.net to get a copy of this message
From:             
Operating system: Mac OS X
PHP version:      5.3.6
Package:          Unknown/Other Function
Bug Type:         Bug
Bug description:Missing semicolon in DATE_ISO8601 Predefined Constant for date()

Description:
------------
It would appear that there is a mistake in the DATE_ISO8601 predefined
constant 
for the date() function.

current output: 2011-07-22T00:00:00-0500
desired output: 2011-07-22T00:00:00-05:00 

http://www.php.net/manual/en/class.datetime.php#datetime.constants.iso8601

http://en.wikipedia.org/wiki/ISO_8601

Test script:
---------------
As best as I can tell, there's supposed to be a semicolon between the
timezone offset hours:minutes.

<?php
$d = mktime (0, 0, 0, '03', '08', '2011');
// 2011-03-08T00:00:00-0600 <-- actual, incorrect (?) result
echo date(DATE_ISO8601, $d).'<br>';

// 2011-03-08T00:00:00-0600
echo date("Y-m-d\TH:i:sO", $d).'<br>';

// 2011-03-08T00:00:00-06:00 <-- expected result
echo date("Y-m-d\TH:i:sP", $d).'<br>';

?>

So the format for DATE_ISO8601 should be "Y-m-d\TH:i:sP" (capital P at the
end), not "Y-m-d\TH:i:sO" (capital O at the end).

Expected result:
----------------
// 2011-03-08T00:00:00-0600 <-- actual, incorrect (?) result
echo date(DATE_ISO8601, $d);

Actual result:
--------------
// 2011-03-08T00:00:00-06:00 <-- expected result
echo date("Y-m-d\TH:i:sP", $d);

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



Thread (4 messages)

« previous php.bugs (#162138) next »