note 31601 added to function.time
| From: | derDoc at gmx dot de | Date: | Sun, 27 Apr 2003 20:59:02 +0000 |
| Subject: | note 31601 added to function.time | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-47179@lists.php.net to get a copy of this message | ||
Ok, now I'm confused.
I'd like to think that date() is adding 1h to the timestamp because I'm at GMT+1 whereas
gmdate() is doing nothing to the stamp. So I called:
echo date ("M d Y H:i:s", 0);
echo gmdate ("M d Y H:i:s", 0);
echo date ("M d Y H:i:s", mktime (5,0,0,1,1,1998));
echo gmdate("M d Y H:i:s", mktime (5,0,0,1,1,1998));
which gave me the expected
Jan 01 1970 01:00:00
Jan 01 1970 00:00:00 and
Jan 01 1998 05:00:00
Jan 01 1998 04:00:00
Then I tried:
echo date ("M d Y H:i:s", time());
echo gmdate("M d Y H:i:s", time());
which produced
Apr 27 2003 22:48:11
Apr 27 2003 20:48:11
Seems pretty odd, but since GMT measures time since January, it knows nothing of daylight savings.
And since now its during daylight saving gmdate accomodates for that. You have to keep that in mind.
--
http://www.php.net/manual/en/function.time.php
http://master.php.net/manage/user-notes.php?action=edit+31601
http://master.php.net/manage/user-notes.php?action=delete+31601
http://master.php.net/manage/user-notes.php?action=reject+31601