I'm having a weird date issue and I'm not sure why?
function checkLog($config){
if($config->sid){
$config->currentDate = date("Y-m-d",strtotime(substr($config->sid,0,8))+86400);
echo $config->currentDate;
}
if($config->currentDate >= date("Y-m-d"))
return 1;
elseif(!empty($config->uid))
return 1;
else
return 0;
}
This is a simple snippet, it compairs the story id with the current date. Anything that is greater than or equal to today's date is flagged one.
It was working fine since I wrote it back in November of last year.
Now however, if I use the following $sid combinations I get very odd results.
$sid = 200310271
Current Date is listed as 2003-10-28 and flagged one.
$sid = 2003102617
Current Date is listed as 2003-10-26 and flagged zero. For some reason the date did not get push forward 86400 seconds.
Is there a bug in PHP? Why wouldn't it change the date the same as it does for prior example?
I could easilly have a call made to the db for verification, but that wouldn't fix this peculiar date issue.