|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-05-03 12:14 UTC] John at JGSystems dot net
Running PHP with BadBlue on Two machines. One Win2K Pro, the other XP SPK1. Also on a Linux Apache production machine.
"T" Option to the date function appears to display incorrectly. Shows Mountain Standard Time all the time. It is now Daylight Savings Time here in Montana.
Script:
php print "This page was last modified:<br>".date("l - F d, Y \\a\\t g:i A T.", getlastmod())
Under my Apache servers PHP displays correctly. I use this for the getlastmod() document function. Here is a copy/paste from the same page on two different servers.
Linux Apache (Production Machine):
This page was last modified:
Friday - April 25, 2003 at 11:30 AM MDT.
Windows 2K/XP:
This page was last modified:
Friday - April 25, 2003 at 11:30 AM Mountain Standard Time.
This also happens with a simple date printout:
php print "This page was last modified:<br>".date("l - F d, Y \\a\\t g:i A T.")
Saturday - May 03, 2003 at 11:09 AM Mountain Standard Time.
Hope this helps.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 05:00:01 2025 UTC |
Here ya go: Commands: echo date("r"),"<br>\n"; echo date("I"),"<br>\n"; // uppercase "i" echo date("T"),"<br>\n"; Result: Wed, 20 Aug 2003 19:33:34 -0600 1 BST This what you wanted? (I hope)Um, sorry if I'm cluttering the list... This bug is half a year old so I'm wondering if/when it's going to get fixed. Y'all probably know what's going on, but allow me to clarify what I've learned about this bug, perhaps it will help someone. date('T') doesn't work under Windows during Daylight times and there's no notation of this in the manual. I'll put a user comment in there. Here's a test script: <?php echo 'Local: dT='.date('T') . ' dO='.date('O') . ' sZ='.strftime('%Z'); echo "\n<br />"; putenv('TZ=EST5EDT'); echo 'EST5EDT: dT='.date('T') . ' dO='.date('O') . ' sZ='.strftime('%Z'); echo "\n<br />"; putenv('TZ=PST8PDT'); echo 'PST8PDT: dT='.date('T') . ' dO='.date('O') . ' sZ='.strftime('%Z'); echo "\n<br />"; putenv('TZ=GMT0BST'); echo 'GMT0BST: dT='.date('T') . ' dO='.date('O') . ' sZ='.strftime('%Z'); echo "\n<br />"; putenv('TZ=MST-3MDT'); echo 'MST-3MDT: dT='.date('T') . ' dO='.date('O') . ' sZ='.strftime('%Z'); echo "\n<br />"; putenv('TZ=GMT'); echo 'GMT: dT='.date('T') . ' dO='.date('O') . ' sZ='.strftime('%Z'); ?> OUTPUT DURING EASTERN DAYLIGHT TIME ----------------------------------- Local: dT=BST dO=-0400 sZ=Eastern Daylight Time EST5EDT: dT=BST dO=-0400 sZ=EDT PST8PDT: dT=BST dO=-0700 sZ=PDT GMT0BST: dT=BST dO=+0100 sZ=BST MST-3MDT: dT=BST dO=+0400 sZ=MDT GMT: dT=GMT dO=+0000 sZ=GMT OUTPUT DURING EASTERN STANDARD TIME ----------------------------------- Local: dT=Eastern Standard Time dO=-0500 sZ=Eastern Standard Time EST5EDT: dT=EST dO=-0500 sZ=EST PST8PDT: dT=PST dO=-0800 sZ=PST GMT0BST: dT=GMT dO=+0000 sZ=GMT MST-3MDT: dT=MST dO=+0300 sZ=MST GMT: dT=GMT dO=+0000 sZ=GMTtname[0] is replaced with tzname[0] if it exists, the same should be done with tname[1] but it doesn't need set to ??? like tname[0] since the default value is BST set in the tname declaration. I've tested this patch on windows and will try to test on linux. Patch --- diff -u datetime.c datetime.c.patched --- datetime.c 2004-02-10 12:30:17.000000000 +0000 +++ datetime.c.patched 2004-02-10 12:32:12.000000000 +0000 @@ -324,6 +324,10 @@ } else { tname[0] = "???"; } + + if (tzname[1] != NULL) { + tname[1] = tzname[1]; + } #endif }