note 44523 deleted from function.date by tomsommer

From: Date: Mon, 09 Aug 2004 01:21:19 +0000
Subject: note 44523 deleted from function.date by tomsommer
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-74274@lists.php.net to get a copy of this message
Note Submitter: rakkis at rakkis dot net ---- To add to my previous post, the hour component of the time should also be in 24h format with leading zeros. So here's the final function :) function _iso8601Date($time) { $tzd = date('O', $time); $tzd = $tzd[0] . str_pad((int) ($tzd / 100), 2 , "0", STR_PAD_LEFT) . ':' . str_pad((int) ($tzd % 100), 2 , "0", STR_PAD_LEFT); $date = date('Y-m-d\\TH:i:s', $time) . $tzd; return $date; }

« previous php.notes (#74274) next »