|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-03-30 10:13 UTC] bfoddy at mn dot mediaone dot net
[2001-05-05 15:40 UTC] rasmus@php.net
[2001-05-07 12:52 UTC] derick@php.net
[2001-05-07 14:10 UTC] bfoddy at mn dot mediaone dot net
[2001-07-13 10:50 UTC] bfoddy at mn dot mediaone dot net
[2001-10-21 21:07 UTC] sniper@php.net
[2001-11-07 09:22 UTC] jmoore@php.net
[2002-01-18 15:29 UTC] bfoddy at mn dot mediaone dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 21:00:01 2025 UTC |
gmmktime is producing a timestamp 1 hour off when the timezone is standard time. If you compare a time() with gmmktime with current settings and a is_dst value NULL, the results will be one hour off. I used the following little script to prove this: <? print ("<PRE>"); print ("Time function = ".time ()); print ("\n"); print ("gmmktime = ".gmmktime (18,25,0,3,20,2001)); print ("\n"); print ("mktime = ".mktime(12,25,0,3,20,2001)); print ("\n"); print (gmmktime(7,0,0,4,1,2001)." ".mktime(1,0,0,4,1,2001)."\n"); print (gmmktime(8,0,0,4,1,2001)." ".mktime(3,0,0,4,1,2001)."\n"); ?> Currently, the US/Central timezone is -6 hours from GMT. I believe the problem is in ext/standard/datetime.c, line 186. Judging from the code, "timezone" seems to be a negative seconds value from GMT, probably of the standard timezone (TZ in standard). So if is_dst == 0, you don't want to add anything more. I think the like should say: gmadjust = -(is_dst ? timezone - 3600 : timezone ); And the comment about overcorrecting removed. My test script works if this line is changed.