Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

strtotime() before 1970 always -1

Status
Not open for further replies.

Shrp

IS-IT--Management
Jan 9, 2002
82
US
I have a web server account that's running MySQL 4.0.22-standard. I have a table with a $DateLong field of type "date" that has dates before 1970. I need to find the day of the week for these dates, which works for the most part with date('D',strtotime($DateLong)). But strtotime() always returns a -1 for pre-1970 dates. Thanks!
 
That's because strtotime() returns an integer that counts the number of seconds after 19700101 00:00:00. This Unix Epoch timestamp is probably assuming that the world began at that time.

You might try looking at some PEAR classes (

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top