This is really weird for me.
I tried: <?php echo strtotime(date("Ymd H:i:s")); ?> <?php echo strtotime(date("Ymd H:i:s")); ?>
He's back: 1351498120 .
Also, when I ran this query: SELECT UNIX_TIMESTAMP(now()) ,
he returned the same result: 1351498120 .
But when I tried: <?php echo strtotime(date("2012-10-29 18:00:00")); ?> <?php echo strtotime(date("2012-10-29 18:00:00")); ?>
It returns: 1351533600 .
If I run this query: SELECT UNIX_TIMESTAMP('2012-10-29 18:00:00') ,
he returns: 1351513800
Now my question is: why are the php and mysql timestamps the same for the current date, but different for future dates? Is there any way to compare them for future dates?
(NOTE: I have UTC as the default timezone in php)
source share