Can anyone explain to me why this snippet doesnt return a timestamp?
- I need the function to compare to dates to check that the "fromdate" actually takes place after the "todate", but i found out that my script would pass strtotime("2209-08-15") to be an earlier date than strtotime("2010-06-30").

Help would be much appreciated.

	$dbdate_from	=	"2209-08-15";
	$dbdate_to	=	"2010-06-30";

$strto_from	=	strtotime($dbdate_from);
$strto_to		=	strtotime($dbdate_to);

if($strto_from < $strto_to)
//test passed, continue script
else 
//test failed, stop and return error-msg

If i try to echo $strto_from it comes back empty(??)

    Probably because your system is using a signed 32-bit integer for the UNIX timestamp number of seconds, which overflows some time in 2038 (a.k.a. the Y2K38 Bug).

      PS: To work around this, you might want to look into using something like the PEAR Date package, which does not rely on an integer type to represent date/time values.

        Write a Reply...