php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36599 DATE_W3C format constant incorrect
Submitted: 2006-03-03 06:15 UTC Modified: 2006-03-03 08:54 UTC
From: d dot begley at uws dot edu dot au Assigned:
Status: Closed Package: Date/time related
PHP Version: 5.1.2 OS: Solaris 9 (SPARC)
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: d dot begley at uws dot edu dot au
New email:
PHP Version: OS:

 

 [2006-03-03 06:15 UTC] d dot begley at uws dot edu dot au
Description:
------------
The new date() format constants introduced in PHP 5.1.1:

http://www.php.net/manual/en/ref.datetime.php

include a format called DATE_W3C, for which the example shown is:

2005-08-15T15:52:01+0000

Whilst this matches the output of live code in PHP, the actual format of the timezone offset is missing a colon (as per the oft-quoted W3C tech note).  I know adding a colon seems "wrong", but that's what the W3C doc includes:

http://www.w3.org/TR/NOTE-datetime

I came across this as the "standard" W3C format (I know the doc itself isn't a standard) because other specs (such as Dublin Core Metadata) refer to the above URL for format information - therefore, the colon must be "significant", no matter how "wrong" it seems.


Reproduce code:
---------------
date( DATE_W3C, getlastmod() )

Expected result:
----------------
2006-03-03T15:41:46+11:00

Actual result:
--------------
2006-03-03T15:41:46+1100

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-03-03 08:54 UTC] derick@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 12:01:29 2024 UTC