November 4th, 2003, 12:15 PM
sendmail, need to change time 'Sent'
Have redhat 8 on linux, able to do a test successfully with the following example but when I view the e-mail it shows the sent time being 1 hour behind what I need it.
code for test:
$send = mail('email@example.com','testing address4','testing the mail.');
inbox shows 10:30 as time sent when I want it to say 11:30
thx so much, kind of a newbie so please be specific if you help.
November 4th, 2003, 06:22 PM
You need to first figure out if your box [the one where PHP executes to launch teh mail] knows the correct time. Use 'date' from the command line and make sure:
a) the time shown matches your local time (on your watch, or wall clock)
b) make sure it has the corretc time zone
eg, on my box (in east coast US):
[root@minstrel ~]# date
Tue Nov 4 18:10:06 EST 2003
which is the correct time, and I really am in EST (eastern standard time.) If it's wrong, there should be a GUI tool for fixing your clock and timezone. Or you can twiddle /etc/sysconfig/clock. Mine reads:
The second line means my hardward clock in teh computer (which Linux updates as you shutdown.) Is set to local time, not to Universal time.
So now you know your clock is right on the sending box. (And if you had to fix your box's timezone, you're problem is probably already solved.
Send a fresh email message and figure out how to view the full headesr on the message. Depends on your mail client... Look at the "Date:" header... it should (in "show full headers" view of your email client) look like:
Date: Mon, 27 Oct 2003 16:28:15 -0500
or whenver you sent it. "-0500" means five whole hourse behind UTC (which is, by definition, "EST") That finger print (the Date header) is put on by the email client (php in your case) as the message is sent.
Now, if it displays wrong, since the clock and timestamp from teh sender are known to be correct, your local clock must be wrong. Your local email client will adjust date/time stamps based on the timezone settings. Make sure your local box has correct time and timezone.
A common problem is: mail from 'a' to 'b'. 'a' is in EST timezone and 'b' is in EDT timezone (or any other zones one hour apart. You set the clock to the same time (eg, 2:30pm or whatever) send mail and when you read it, your local mail client looks at the timezone difference (stamped in the "-0500" for EST on box "a") and says I'm in EDT -0400 and shifts the *displayed* date anhour...