Bug #13900 Updated: date(I) does not correctly identify daylight saving time
| From: | bmplummer1 at home dot com | Date: | Mon, 05 Nov 2001 03:56:36 +0000 |
| Subject: | Bug #13900 Updated: date(I) does not correctly identify daylight saving time | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-69625@lists.php.net to get a copy of this message | ||
ID: 13900
User updated by: bmplummer1@home.com
Reported By: bmplummer1@home.com
Status: Open
Bug Type: Date/time related
Operating System: Windows NT/XP
PHP Version: 4.0.6
New Comment:
I have two comments about the last entry.
First...
Jeroen, if you ran the same script that you put in your notes then it should have returned a 1 (one)
because the date is May 1 2001 which occurs during daylight saving time.
Second...
On my Win XP pro version 2002, PHP 4.06 CGI version here is what I get:
SCRIPT:
<?php
var_dump(date("I", mktime(0,0,0,5,1,2001)));
?>
OUTPUT:
string(1) "0"
I haven't made any special changes to my PHP.ini. Do I need to load a special module to get
this to work? I have been able to reproduce this on two different systems. On XP and NT 4.0 I used
the PHP installer to automatically install PHP. I also reinstalled PHP 4.06 manually on the XP
system but I only used the php.ini-dist config file.
In the mean time... Anybody know of a daylight saving time detection script before I start writing
this by hand?
Previous Comments:
------------------------------------------------------------------------
[2001-11-04 19:55:34] jeroen@php.net
On my w2k 4.0.4pl1, it returns 1, which is wrong now, since Daylight saving time ended a week ago in
Europe. Same for debian-linux. Both are correctly configured.
What's your output with this script:
<?php
var_dump(date("I", mktime(0,0,0,5,1,2001)));
?>
On my system, it returns string(1) "1"
--Jeroen
------------------------------------------------------------------------
[2001-11-03 01:09:15] bmplummer1@home.com
I downloaded 4.06 again and installed it manually. I have a feeling that my php.ini is somehow
different than the standard because when I tried to use the optimized php.ini file I couldn't
even load my script. But when I used the dist version the script worked (except for the date(I)
part). I must have my PHP configured incorrectly. But why would it do it on two different
computers and two different versions of PHP???
------------------------------------------------------------------------
[2001-11-02 21:56:52] bmplummer1@home.com
Tried it from the command line and got all zeros.
------------------------------------------------------------------------
[2001-11-01 15:44:10] cnewbill@php.net
You said you were running it as a CGI therefore my test should be equivalent without me having to
use Apache.
I don't see how the CGI being called through Apache could do this. BUT jic, please try
executing your PHP CGI from the command line against those test scripts and see if you get the same
results.
-Chris
------------------------------------------------------------------------
[2001-11-01 15:32:35] bmplummer1@home.com
Well, I am getting zeros... I get in on PHP 4.06 on Windows XP pro and I get zeros on PHP 4.05 on
Windows NT 4.0. both are running on Apache. Maybe that is the issue. Are you running PHP on
Apache?
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/?id=13900
Edit this bug report at http://bugs.php.net/?id=13900&edit=1