note 45114 deleted from function.date by derick
| From: | derick@php.net | Date: | Sun, 12 Jun 2005 11:43:40 +0000 |
| Subject: | note 45114 deleted from function.date by derick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-90292@lists.php.net to get a copy of this message | ||
Note Submitter: burden123 at rogers dot com
----
more fixes for iso 8601, based on rakkis at rakkis dot net 's changes. This one fixes the
problem of two negative signs if your time zone was in the negatives (i got "--5:00").
Also, should have leading zeros for the hour and time zone values. After spending a few on this one,
that PHP 5 function is looking attractive ^_^ :
function iso8601_date($time) {
$tzd = date('O',$time);
$tzd = substr(chunk_split($tzd, 3, ':'),0,6);
$date = date('Y-m-d\TH:i:s', $time) . $tzd;
return $date;
}