Jump to content


PHP Mail date wrong

  • Please log in to reply
1 reply to this topic

#1 ben14

  • Members
  • PipPip
  • Member
  • 10 posts
  • LocationPerth, Western Australia

Posted 01 May 2006 - 02:19 AM

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?

#2 phporcaffeine

  • Members
  • PipPipPip
  • Advanced Member
  • 361 posts
  • LocationOhio, USA

Posted 01 May 2006 - 02:56 AM

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?

Ryan Huff
President & Founder, MyCodeTree
support@mycodetree.com | http://mycodetree.com

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users