ID:               29334
 Updated by:       [EMAIL PROTECTED]
 Reported By:      php dot time dot bug at aaronoff dot com
-Status:           Open
+Status:           Closed
 Bug Type:         Mail related
 Operating System: win32
 PHP Version:      5CVS, 4CVS (2005-02-05)
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Fixed in PHP 5. Make sure you set "date.timezone" properly in your
php.ini or by using date_default_timezone_set() function.
The mail() function under win32 now uses same function as date("r");
does. 


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

[2005-04-21 23:14:44] jbrady at sbccd dot cc dot ca dot us

We have 2 windows 2003 IIS6 servers with php 5.0.2 (build date Sep 24
2004 01:24:24) and php 5.0.3 (build date Dec 15 2004 08:06:41). We have
this same problem.

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

[2005-04-06 16:20:10] mike-php at emerge2 dot com

Interestingly, a call to date( 'r' ) returns the expected string, and
even pays attention to the setting in the Date Control Panel. Perhaps
mail() could simply call PHP's own date( 'r' ) function to create the
Date Header?

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

[2004-07-22 18:25:19] php dot time dot bug at aaronoff dot com

Description:
------------
I'm using the mail() function to send a message from my home SMTP
server to my domain's SMTP server via my installation of MS IIS 5.0
SMTP under W2K SP4.

The time zone for my home PC is GMT +0200 in summer (with DST), +0100
in winter (w/o DST). In Windows Control Panel, Date/Time Properties,
Time Zone tab, the time zone shows as +0100 and "Automatically adjust
time for daylight saving changes" is checked. DST, then, increases the
offset on my PC from +0100 to +0200.

The e-mail message retrieved by my e-mail client from my domain's SMTP
server has a message header Date field set to the right hour but at GMT
offset +0100 -- this is the wrong time. Since my e-mail client displays
messages with time sent corrected to my local time, it adds an hour and
the message shows with a time one hour *ahead* of the time it was
actually sent.

Ex: message sent by mail() at 16:10 +0200
    Date field in message header on home SMTP server shows 16:10 +0100
<-- this is the wrong time!
    message sent by home SMTP server at 16:10 +0200
    message received by e-mail client from domain at 16:11 +0200
    e-mail client shows sent message time of 17:10 +0200

If a text message with just From:, To: and Subject: headers is dropped
into the home SMTP "Queue" folder, the home SMTP server adds the local
time with the correct GMT offset to the message header Date field. This
shows that the problem is not coming from the home SMTP server itself,
but from the program that's providing it with date information.

IMHO, mail() is not using the correcting the GMT offset for DST.

I've been unable to find any mention of an INI-file parameter for this,
Googling results were meager, and I found no open bugs.

HTH.

regards, Andy

Reproduce code:
---------------
mail($dest,$subject,$body)

Expected result:
----------------
The Date: field in the message's header should show the correct hour
and GMT offset.

Actual result:
--------------
The Date: field in the message's header shows the correct hour but the
wrong GMT offset -- it's not corrected for DST.


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


-- 
Edit this bug report at http://bugs.php.net/?id=29334&edit=1

Reply via email to