By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,889 Members | 1,044 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,889 IT Pros & Developers. It's quick & easy.

Email timestamp conundrum

P: n/a
I have several scripts that send email using PHP's mail() function. I
recently noticed that the time sent displayed inside those messages is
approximately one hour ahead of the actual time. (It's not exactly an
hour. It tends to be within 58-62 minutes ahead.)

Stranger still, the time that is displayed as incorrect is only
_inside_ the message. The time that is displayed for the message as it
appears in my inbox, before the message is opened is correct.

Working with my IT department, we haven't been able to determine what
is setting the incorrect time that is displayed inside the message.

Manually adjusting the time of our mail server (running Windows 2000
SP4) affects the correct time that is displayed in the inbox. But
neither changing the mail server's clock -- nor changing the clock of
the Web server (also running Windows 2000 SP4) -- seems to change the
incorrect time that is displayed inside the message.

A shiny new donkey to the first person who can figure this one out.
Jul 17 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Craig Bailey wrote:
I have several scripts that send email using PHP's mail() function. I
recently noticed that the time sent displayed inside those messages is
approximately one hour ahead of the actual time. (It's not exactly an
hour. It tends to be within 58-62 minutes ahead.)

Stranger still, the time that is displayed as incorrect is only
_inside_ the message. The time that is displayed for the message as it
appears in my inbox, before the message is opened is correct.

Working with my IT department, we haven't been able to determine what
is setting the incorrect time that is displayed inside the message.

Manually adjusting the time of our mail server (running Windows 2000
SP4) affects the correct time that is displayed in the inbox. But
neither changing the mail server's clock -- nor changing the clock of
the Web server (also running Windows 2000 SP4) -- seems to change the
incorrect time that is displayed inside the message.


Is the mail really sent at once?
The mail may end in a mailque for approx a hour before it's sent, this may
cause the time difference.
//Aho
Jul 17 '05 #2

P: n/a
["Followup-To:" header set to comp.lang.php.]
Craig Bailey wrote:
I have several scripts that send email using PHP's mail() function. I
recently noticed that the time sent displayed inside those messages is
approximately one hour ahead of the actual time. (It's not exactly an
hour. It tends to be within 58-62 minutes ahead.)

Stranger still, the time that is displayed as incorrect is only
_inside_ the message. The time that is displayed for the message as it
appears in my inbox, before the message is opened is correct.

Working with my IT department, we haven't been able to determine what
is setting the incorrect time that is displayed inside the message.

Manually adjusting the time of our mail server (running Windows 2000
SP4) affects the correct time that is displayed in the inbox. But
neither changing the mail server's clock -- nor changing the clock of
the Web server (also running Windows 2000 SP4) -- seems to change the
incorrect time that is displayed inside the message.

A shiny new donkey to the first person who can figure this one out.


I just run this script (with a different address):
<?php mail('h*****@hotpop.com', 'sub', 'msg body'); ?>

and the mail I received was (except for the line numbering and censoring):
1 From ================= Thu Jun 24 17:14:47 2004
2 Return-Path: =================
3 Delivered-To: =================
4 Received: by ============= (Postfix, from userid 1000)
5 id 34F1017DB2; Thu, 24 Jun 2004 17:14:47 +0100 (WEST)
6 To: he****@hotpop.com
7 Subject: sub
8 Message-Id: <20040624160447.34F1017DB2@=============>
9 Date: Thu, 24 Jun 2004 17:14:47 +0100 (WEST)
10 From: Pedro <=================>
11
12 msg body
so there are 3 dates in the headers
line 1: Thu Jun 24 17:14:47 2004
line 5: Thu, 24 Jun 2004 17:14:47 +0100 (WEST)
line 9: Thu, 24 Jun 2004 17:14:47 +0100 (WEST)

line 5 and line 9 have the same date; line 1 apparently also has the
same date, but without the offset, how can I be sure?

My Mail User-Agent (mutt) is configured to not display dates at all.
Maybe your Mail User-Agent uses dates from different headers in
the inbox view and in the message view.
If this answers your question, you can keep the shiny new donkey :-)
--
USENET would be a better place if everybody read: | to email me: use |
http://www.catb.org/~esr/faqs/smart-questions.html | my name in "To:" |
http://www.netmeister.org/news/learn2quote2.html | header, textonly |
http://www.expita.com/nomime.html | no attachments. |
Jul 17 '05 #3

P: n/a
Craig Bailey wrote:
I have several scripts that send email using PHP's mail() function. I
recently noticed that the time sent displayed inside those messages is
approximately one hour ahead of the actual time. (It's not exactly an
hour. It tends to be within 58-62 minutes ahead.)

Stranger still, the time that is displayed as incorrect is only
_inside_ the message. The time that is displayed for the message as it
appears in my inbox, before the message is opened is correct.

Working with my IT department, we haven't been able to determine what
is setting the incorrect time that is displayed inside the message.

Manually adjusting the time of our mail server (running Windows 2000
SP4) affects the correct time that is displayed in the inbox. But
neither changing the mail server's clock -- nor changing the clock of
the Web server (also running Windows 2000 SP4) -- seems to change the
incorrect time that is displayed inside the message.

A shiny new donkey to the first person who can figure this one out.


does your code place a timestamp inside the email? or is this being
inserted by the server itself? You might make sure that your timezone
and timezone offsets are set correctly at the OS level. Is this
Exchange mail or a sendmail application -- I don't use PHP on WNT so I
am not quite sure about it...

Oh!!! how about your Daylight-Savings time setup? is it correct? are you
using GMT or is it set to, say, CST instead of CDT (or whatever) This
would cause it to be ~1 hour ahead - give or take a minute or two for
processing time....

It has to be something with your system. (d'oh!)

================= the code =========================
<?php

$d = date("D M j G:i:s T Y");
$name = "World";
$line = "Hello ";
$outline = $line.$name." ".$d."\n";
echo $outline;
$stat = mail("ma*****@firstdbasource.com","Testing Mail",$outline);
echo $stat;
?>
================================================== ==

================= on the web page ==================
Hello World Thu Jun 24 11:10:04 CDT 2004
1
================================================== ==
================= the email ========================

From: SMTP%"na**@removed.dom"
To: ma*****@firstdbasource.com
CC:
Subj: Testing Mail

Date: Thu, 24 Jun 2004 11:10:05 -0500 (CDT)
Message-Id: <04************@firstdbasource.com>
From: na**@removed.dom
To: MA*****@firstdbasource.com
Subject: Testing Mail

Hello World Thu Jun 24 11:10:04 CDT 2004

================================================== ==
(I had some things stuck in my mail queue otherwise the timestamps would
have been the same...)

Michael Austin.
Jul 17 '05 #4

P: n/a
On 24 Jun 2004 16:19:40 GMT, Pedro Graca <he****@hotpop.com> wrote:
["Followup-To:" header set to comp.lang.php.]
Craig Bailey wrote:
I have several scripts that send email using PHP's mail() function. I
recently noticed that the time sent displayed inside those messages is
approximately one hour ahead of the actual time. (It's not exactly an
hour. It tends to be within 58-62 minutes ahead.)

Stranger still, the time that is displayed as incorrect is only
_inside_ the message. The time that is displayed for the message as it
appears in my inbox, before the message is opened is correct.

Working with my IT department, we haven't been able to determine what
is setting the incorrect time that is displayed inside the message.

Manually adjusting the time of our mail server (running Windows 2000
SP4) affects the correct time that is displayed in the inbox. But
neither changing the mail server's clock -- nor changing the clock of
the Web server (also running Windows 2000 SP4) -- seems to change the
incorrect time that is displayed inside the message.

A shiny new donkey to the first person who can figure this one out.


I just run this script (with a different address):
<?php mail('he****@hotpop.com', 'sub', 'msg body'); ?>

and the mail I received was (except for the line numbering and censoring):
1 From ================= Thu Jun 24 17:14:47 2004
2 Return-Path: =================
3 Delivered-To: =================
4 Received: by ============= (Postfix, from userid 1000)
5 id 34F1017DB2; Thu, 24 Jun 2004 17:14:47 +0100 (WEST)
6 To: he****@hotpop.com
7 Subject: sub
8 Message-Id: <20040624160447.34F1017DB2@=============>
9 Date: Thu, 24 Jun 2004 17:14:47 +0100 (WEST)
10 From: Pedro <=================>
11
12 msg body
so there are 3 dates in the headers
line 1: Thu Jun 24 17:14:47 2004
line 5: Thu, 24 Jun 2004 17:14:47 +0100 (WEST)
line 9: Thu, 24 Jun 2004 17:14:47 +0100 (WEST)

line 5 and line 9 have the same date; line 1 apparently also has the
same date, but without the offset, how can I be sure?

My Mail User-Agent (mutt) is configured to not display dates at all.
Maybe your Mail User-Agent uses dates from different headers in
the inbox view and in the message view.
If this answers your question, you can keep the shiny new donkey :-)


Yous systems TZ variable is missing or hosed. Make sure the ID
running the script knows what the TZ is.
If you were in the USEastern timezone for instance, it'd be EST5 or
EST5EDT

It's entirely possible you have:

One TZ set for the ID you usually log in as
One for the ID the script is running under
and One for "root", the ID sendmail uses to do it's thing.
--
gburnore@databasix dot com
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ۳ݳ޳ݳۺݳ޳ݳݳ޳ݳ۳
| ۳ݳ޳ݳۺݳ޳ݳݳ޳ݳ۳
DataBasix | ۳ݳ޳ݳۺݳ޳ݳݳ޳ݳ۳
| ۳ 3 4 1 4 2 ݳ޳ 6 9 0 6 9 ۳
Black Helicopter Repair Svcs Division | Official Proof of Purchase
================================================== =========================
Want one? GET one! http://www.databasix.com
================================================== =========================
Jul 17 '05 #5

P: n/a
In article <Fh*****************@newssvr23.news.prodigy.com> ,
Michael Austin <ma*****@firstdbasource.com> wrote:
does your code place a timestamp inside the email? or is this being
inserted by the server itself?
Apparently some server or other. My PHP code is not inserting or
otherwise tinkering with the time (as far as I know).
Exchange mail or a sendmail application -- I don't use PHP on WNT so I
am not quite sure about it...
It's Exchange mail.
Oh!!! how about your Daylight-Savings time setup? is it correct? are you
using GMT or is it set to, say, CST instead of CDT (or whatever) This
would cause it to be ~1 hour ahead - give or take a minute or two for
processing time....


The time on both the Exchange server and the Web server are correct (and
identical). We tried changing both to see if we could change this
incorrect timestamp, and neither had an effect!

--
Floydian Slip(tm) - "Broadcasting from the dark side of the moon"
Random Precision Productions(tm)
67 Union St. #2D, Winooski, Vt. 05404-1948 USA
Sundays, 7-8 pm - Champ 101.3 FM, Colchester; 102.1 FM, Randolph, Vt.
cc*@floydianslip.com - AIM: RandomPrec - www.floydianslip.com
Jul 17 '05 #6

P: n/a
Craig Bailey wrote:
In article <Fh*****************@newssvr23.news.prodigy.com> ,
Michael Austin <ma*****@firstdbasource.com> wrote:

does your code place a timestamp inside the email? or is this being
inserted by the server itself?

Apparently some server or other. My PHP code is not inserting or
otherwise tinkering with the time (as far as I know).

Exchange mail or a sendmail application -- I don't use PHP on WNT so I
am not quite sure about it...

It's Exchange mail.

Oh!!! how about your Daylight-Savings time setup? is it correct? are you
using GMT or is it set to, say, CST instead of CDT (or whatever) This
would cause it to be ~1 hour ahead - give or take a minute or two for
processing time....

The time on both the Exchange server and the Web server are correct (and
identical). We tried changing both to see if we could change this
incorrect timestamp, and neither had an effect!


changing the time has nothing to do with the timezone and timezone
offset. Check the TZ and daylight-savings stuff... I hate M$ Exchange
so I don't have it here to tell you how to do that... others might..

Michael Austin.
Jul 17 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.