note 44346 added to function.date
| From: | kop at meme dot com | Date: | Wed, 21 Jul 2004 16:40:17 +0000 |
| Subject: | note 44346 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-73830@lists.php.net to get a copy of this message | ||
The only way to be _certain_ you're getting a valid human-readable UTC time value out of date()
is to cache the timestamp, like so:
$t=time;
// Produce a OpenLDAP timestamp value, UTC time.
$utc_time = date ('YmdHis', $t - date('Z', $t)) . 'Z';
Otherwise if daylight savings time ticks over between the determination of the current time and the
determination of the current UTC offset your result will be off by 2 hours!
It's easier to use gmdate().
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+44346
Delete -- http://master.php.net/manage/user-notes.php?action=delete+44346&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+44346&report=yes
Search -- http://master.php.net/manage/user-notes.php