...

View Full Version : Check date validity, while allowing different date formats



user.name
02-22-2012, 05:32 AM
Hi,

When i strtotime the year 1959 and below, php returns a timestamp value that when echoed as date('Y'), returns 2012, instead of 1959.

How do i get the correct timestamp value of years 1959 and below?

Thanks,

My php=5.2, os-32bit

cercos
02-22-2012, 05:55 AM
I think it's outputting the 2012 because strtotime() starts at 1970.


Try this (http://stackoverflow.com/questions/2871264/using-strtotime-for-dates-before-1970) if this doesn't help Google "strtotime before 1970":

user.name
02-22-2012, 06:09 AM
I think it's outputting the 2012 because strtotime() starts at 1970.


Try this (http://stackoverflow.com/questions/2871264/using-strtotime-for-dates-before-1970) if this doesn't help Google "strtotime before 1970":

Hi,

Thanks for the link but that didn't help. I did a lot of google searches too, before posting here, so...


Thanks anyway :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum