#36531 [Opn->Fbk]: date() prints the wrong hour seemingly randomly
| From: | derick@php.net | Date: | Tue, 28 Feb 2006 17:36:48 +0000 |
| Subject: | #36531 [Opn->Fbk]: date() prints the wrong hour seemingly randomly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-93773@lists.php.net to get a copy of this message | ||
ID: 36531
Updated by: derick@php.net
Reported By: tehughes at wisc dot edu
-Status: Open
+Status: Feedback
Bug Type: Date/time related
Operating System: linux
PHP Version: 4.4.2
New Comment:
The only thing that could cause this is when you are playing with the
TZ environment variable in your scripts. Try to print out the timezone
abbreviation in your script too and see what it does.
Previous Comments:
------------------------------------------------------------------------
[2006-02-28 18:12:14] tehughes at wisc dot edu
Is there any sort of server configuration that could screw this up?
------------------------------------------------------------------------
[2006-02-28 18:07:39] bjori@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
Can't reproduce in 4.4.3-dev
(Should btw. print 12:00pm)
------------------------------------------------------------------------
[2006-02-26 01:30:04] judas dot iscariote at gmail dot com
your problem is not reproducible in latest PHP 5.1.3-dev CVS,apache 2 ,
linux/amd64.
------------------------------------------------------------------------
[2006-02-25 22:38:55] tehughes at wisc dot edu
Description:
------------
date("g",x) where x is some int literal will print out
different things depending on when I load it, either 2 hours
before or after the actual time.
Reproduce code:
---------------
echo "[[" . date("g:ia",39600) . "]]";
Expected result:
----------------
At this point I'm actually not sure what the correct time is.
PHP gives me 4:00am or 6:00am depending on the page load.
I have no idea what could be causing this.
Actual result:
--------------
[[6:00am]]
-- next page load --
[[4:00am]]
-- next page load --
[[4:00am]]
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36531&edit=1