note 81307 modified in function.date by danbrown
| From: | danbrown@php.net | Date: | Sun, 17 May 2009 18:58:01 +0000 |
| Subject: | note 81307 modified in function.date by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-155193@lists.php.net to get a copy of this message | ||
The PHP4 replacement for ISO8601 posted by fokeyjoe has a little flaw:
The time in ISO is in 24 hour format, so an uppercase H must be used.
Correct format is:
<?php
$sISO8601=date('Y-m-d\TH:i:s',$nTimestamp).
substr_replace(date('O',$nTimestamp),':',3,0);
?>
Short version for NOW:
<?php
$sISO8601=date('Y-m-d\TH:i:s'). substr_replace(date('O'),':',3,0);
?>
--was--
The PHP4 replacement for ISO8601 posted by fokeyjoe has a little flaw:
The time in ISO is in 24 hour format, so an uppercase H must be used.
Correct format is:
$sISO8601=date('Y-m-d\TH:i:s',$nTimestamp).
substr_replace(date('O',$nTimestamp),':',3,0);
Short version for NOW:
$sISO8601=date('Y-m-d\TH:i:s'). substr_replace(date('O'),':',3,0);
http://php.net/manual/en/function.date.php