View Single Post
Old 05-28-2011, 10:52 PM   #1 (permalink)
pepelepew1962
The Wanderer
 
Join Date: Jan 2010
Posts: 13
Thanks: 0
pepelepew1962 is on a distinguished road
Default strtotime calculations inaccurate ...

//
I am trying to calculate the number of days between dates and have a major problem. When I try the example below, it gives me exactly 201 days, yet the dates have different times, meaning that a full day is impossible. If it matters, I am testing via xampp 1.7.3 with php version 5.3.1 with Windows XP. Can anyone explain what I am doing wrong. Can daylight savings play a role?

$frmritedate7116 = strtotime('2010-12-13 23:00');
$frmritedate7156 = strtotime('2010-05-27 00:00');
//
$frmritedate7251 = $frmritedate7156 - $frmritedate7116;
//
//
1274943600-1292310000=-17366400 // 86400 seconds in a day ( 201.00 )
//
//
//
pepelepew1962 is offline  
Reply With Quote