Jump to content

PHP Mail date wrong


ben14

Recommended Posts

Ok, when i send any emails from php the date that comes through on the email is the 01/01/1970. This only seems to happen in window mail clients, but on macs, gmail the date is correct.

Wondering if anyone knows what could be the problem and what the fix is?
Link to comment
Share on other sites

Well there are several factors here.

1.) Look at the header of a received piece of mail, make sure the header date/time is really wrong, or is it the email client interpreting wrong? Probably wrong in the header but worth a look

2.) Depending on your version of PHP (5.0.5+ I think) in the PHP.ini you can set your default timezone and php bases all date functions off of the timezone, this is worth checking into as well (default.timezone = US/Eastern .... etc).

3.) It's funny that you mention January 1, 1970 as that is the date of the UNIX Epoch to which all UNIX timestamps start counting seconds from. Are you sure your not stamping the email your sending (using mktime() perhaps?) and maybe not doing a proper calculation of some sort?
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.