473,809 Members | 2,791 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Email timestamp conundrum

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
6 5055
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
["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*****@ho tpop.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.c om
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
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*****@f irstdbasource.c om","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**@remo ved.dom"
To: ma*****@firstdb asource.com
CC:
Subj: Testing Mail

Date: Thu, 24 Jun 2004 11:10:05 -0500 (CDT)
Message-Id: <04************ @firstdbasource .com>
From: na**@removed.do m
To: MA*****@firstdb asource.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
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****@ho tpop.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.c om
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@databa six 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
In article <Fh************ *****@newssvr23 .news.prodigy.c om>,
Michael Austin <ma*****@firstd basource.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) - "Broadcasti ng 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*@floydiansli p.com - AIM: RandomPrec - www.floydianslip.com
Jul 17 '05 #6
Craig Bailey wrote:
In article <Fh************ *****@newssvr23 .news.prodigy.c om>,
Michael Austin <ma*****@firstd basource.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
9310
by: perplexed | last post by:
How do you convert a user inputted date to a unix timestamp before insterting it into your database? I have a form, with a textfield for a date that the user inputs in the format mm-dd-yyyy and three dropdow boxes for hours, minutes, and AM/PM. All of these need to be considered together and converted to one Unix Timestamp and then inserted to the MYSQL date field. The type of field is INT (11) so that I can instead of the standard...
4
2410
by: Bill | last post by:
I was under the impression from the manual that if you added a field to a table of type timestamp this would automatically be updated after each insert/update of a new record, but all I get is 00000000. Is there something else I should set? Thanks.
2
5185
by: rong.guo | last post by:
Hello Group, I am having a really weird problem... Can anyone tell the difference between Query 1 and Query 2 below? Why Query 2 excludes '2/28/2005'? Many thanks! create table a (ApplicationID int ,timestamp datetime)
4
1953
by: Jim Ford | last post by:
I have a single C file with the following code: int f2() { /* Blah-blah */ } int f1() { /* Blah-blah */
4
1720
by: Jim Owen | last post by:
I am storing all my application data in the application cache. Anytime I have a method as part of an asp.net form, I need to access the objects in the cache. The only way I can think of to do this is to call something like: MyDataType LocalVar = (MyDataType)Cache; Which works fine, but I'm having to put that code at the top of every method in my form that uses the cached data. It seems there must be a more elegant way to do this. I...
2
4375
by: Russell Smith | last post by:
Timestamps support infinity. However if appears dates do not. When timestamps are cast to dates, there is no output. Is this an acceptable option or not? Below are a number of examples showing what I am experiencing. The last own shows how converting timestamps to dates and then ordering doesn't give you the order you want. Maybe you should just order by the timestamp to begin with. However Date does not understand infinity at all.
22
6434
by: Mal Ball | last post by:
I hope I have the right forum for this question. I have an existing Windows application which uses a SQL Server database and stored procedures. I am now developing a web application to use the same database. The original Update and Delete SP's all use a timestamp for concurreny checking. I am trying to use the same Update SP from my sqlDataSource but I keep getting the following error:
2
3169
by: subnunciation | last post by:
i know, this shouldnt be a conundrum right? one just shouldnt divide by zero. but this is suddenly happening *all over* my site. after chasing the error here and there, i simplified things down to: response.write cstr(4/2) response.end and i STILL get the error: Microsoft VBScript runtime error '800a000b' Division by zero
7
6121
by: JJ | last post by:
How do I set one field to have the updated timestamp, and another to have the created timestamp? I want to do this directly from code generated from DB Designer if possible?! JJ
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10635
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10378
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10115
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9198
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5687
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.