possible bug in date()
| From: | Mark Slater | Date: | Tue, 18 Apr 2006 02:23:55 +0000 |
| Subject: | possible bug in date() | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-234154@lists.php.net to get a copy of this message | ||
I'm trying to create a date with the DATE_W3C or DATE_ATOM format (they are the same format according to the examples), but the output of date doesn't match the example in the documentation.
The http://us3.php.net/manual/en/ref.datetime.php page says the formats are as follows:
DATE_ATOM (string)
Atom (example: 2005-08-15T15:52:01+00:00)
DATE_W3C (string)
World Wide Web Consortium (example: 2005-08-15T15:52:01+00:00)
DATE_ISO8601 (string)
ISO-8601 (example: 2005-08-15T15:52:01+0000)
If I create a date with this code:
$this->dateCreated = date( DATE_ATOM, mktime( 0, 0, 0, 23, 2, 2006 ) );
echo $this->dateCreated;
I expect to see:
2006-02-23T00:00:00-08:00The output I actually get is the ISO-8601 format:
2006-02-23T00:00:00-0800The only difference is the colon in the GMT offset at the end. Is the example output in the web page wrong? Or is this a bug in PHP? Thanks, Mark