Login   Register  
PHP Classes
elePHPant
Icontem

UTC time?

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      Difference between two dates  >  All threads  >  UTC time?  >  (Un) Subscribe thread alerts  
Subject:UTC time?
Summary:My results are off by 5 hours
Messages:1
Author:Marian Boricean
Date:2012-12-24 22:18:08
 

  1. UTC time?   Reply   Report abuse  
Picture of Marian Boricean
Marian Boricean
2012-12-24 22:18:09
Hi!

Thank you for your nice class. I tried to do something like that in the past, but I always had difficulties with the leap years, different understading of what a month is (28,30,31 days?)
Anyway, thank you again.
I have an issue now. I set the "start date" to a couple minutes in the past and I have a difference of 5 hours and something. It looks to me that it's reporting the GMT time.
I tried to add the ini_set for the timezone, but no avail:
Here is the code:

<?php
ini_set('date.timezone', 'America/New_York');
$t = new DiffDates();
echo $t->calcdiff('2012-12-24 16:00:00', date('Y-m-d G:i:s'), ' ', 'ymwdhis');
?>

The result is:
5 h 18 m 12 s
The actual current date is 2012-12-24 16:18

What am I missing?