|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24912 Date function returns incorrect time zone
Submitted: 2003-08-01 18:30 UTC Modified: 2003-08-02 05:08 UTC
From: mark at katmoda dot com Assigned:
Status: Not a bug Package: Mail related
PHP Version: 5.0.0b1 (beta1) OS: windows xp/ win2k
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: mark at katmoda dot com
New email:
PHP Version: OS:


 [2003-08-01 18:30 UTC] mark at katmoda dot com
I just found out this on my windows XP machine:

background info:

- I live in the Netherlands (timezone= GMT+1)

When you enable the option to automaticaly adjust your system clock for daylight savings (on windows' control panel), php's date() function and the Date header in the mail function will return different time zones.

an example:
 $test= date('O');

now $test is: "+0200"

But if I send a mail with php using the mail() function the Date header is telling me +0100 (which seems to me is right because I live in the Netherlands where timezone=GMT+1)

This bug can be caused by windows (returning the wrong timezone to php's date() function). Or php's date() function is doing something wrong itself.

I found this trying to figure out why my emails appeared to be sent one hour later than they really were sent. (I use Mozilla mail and appearantly it suffers from the same bug as php's date() function ).

Reproduce code:
	print(date('D, d M y H:i:s O'));

# This only goes wrong when you have "automaticaly adjust
# clock for daylight saving changes" on:
# control panel> Date and Time> Time zone
# set to enabled

Expected result:
Sat, 02 Aug 03 01:17:02 +0100

Actual result:
Sat, 02 Aug 03 01:17:02 +0200


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-08-01 19:26 UTC]
You are in GMT+0100 in winter and GMT+0200 in summer, see e.g.
<>. GMT doesn't have daylight savings, it's fixed.

 [2003-08-02 03:43 UTC] mark at katmoda dot com
What you state means that there is a bug in de mail() function. Because that function sends a +0100 value with the date header. Isn't this true?
 [2003-08-02 05:08 UTC]
That depends on your system settings / SMTP server's settings. As you failed to give an example script -> bogus.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Feb 06 02:03:46 2023 UTC