note 31375 added to function.time
| From: | schickb at hotmail dot com | Date: | Sat, 19 Apr 2003 04:39:10 +0000 |
| Subject: | note 31375 added to function.time | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-46806@lists.php.net to get a copy of this message | ||
The 10-Apr-2003 comment about time() not actually returning seconds in GMT is incorrect. The time()
function does indeed return seconds since 1-1-1970 GMT (which is a typical unix timestamp). I
checked this by calling time() on machines in several different time zones, and they all returned
the same value.
The commenter was probably confused because the date() function converts GMT timestamps to local
time. If you want to see the non-adjusted GMT date for a timestamp, use the gmdate() function.
You can verify this yourself by passing a timestamp of 0 to both date() and gmdate(). You will find
that gmdate() always returns "1-1-1970 " while date() adjusts for your local offset.
--
http://www.php.net/manual/en/function.time.php
http://master.php.net/manage/user-notes.php?action=edit+31375
http://master.php.net/manage/user-notes.php?action=delete+31375
http://master.php.net/manage/user-notes.php?action=reject+31375