Bug #13900 Updated: date(I) does not correctly identify daylight saving time

From: Date: Mon, 05 Nov 2001 08:15:14 +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-69630@lists.php.net to get a copy of this message
ID: 13900
Updated by: jimw
Reported By: bmplummer1@home.com
Status: Open
Bug Type: Date/time related
Operating System: Windows NT/XP
PHP Version: 4.0.6
New Comment:

perhaps a simple reality check: what timezone does date("T") report? php could be running
in a context with the timezone set to something that doesn't have a daylight savings time.

(and there is no module or php.ini setting that has anything do with what date("I")
reports. if the timezone is correct, and it is wrong, then your c library is broken.)

Previous Comments:
------------------------------------------------------------------------

[2001-11-04 22:56:35] bmplummer1@home.com

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?

------------------------------------------------------------------------

[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

------------------------------------------------------------------------

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



Thread (11 messages)

« previous php.dev (#69630) next »