$date1-sub($date2)-toString(Zend_Date::DAY_OF_YEAR);
When your date differs more than one year, then you need to handle that
also.
Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com
- Original Message -
From: Mathieu Suen
sub() return the number of second. It dosen't return an object(Zend_Date).
Thomas Weidner a écrit :
$date1-sub($date2)-toString(Zend_Date::DAY_OF_YEAR);
When your date differs more than one year, then you need to handle that
also.
Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
Hi,
Using Zend_Date how could we get the difference between 2 date.
Let's say I want the number of day?
Thanks
--
-- Mathieu Suen
--
Maybe this snippet can give you idea
http://www.zfsnippets.com/snippets/view/id/39/time-measurement-with-zendmeasuretime
Regards,
Saša Stamenković
On Wed, Aug 12, 2009 at 2:11 PM, Mathieu Suen mathieu.s...@easyflirt.comwrote:
Hi,
Using Zend_Date how could we get the difference between 2
So if I retrive a date from a MySQL DB I have to do the following?
$date = new Zend_Date();
$date-setTimezone('UTC');
$date-set($dbRow-date, '-MM-dd HH:mm:ss');
$created_at = new Zend_Measure_Time($date-getTimestamp());
$nowDate = new Zend_Date();
$nowDate-setTimezone('UTC');
$now = new
First example is very comfusing, 2nd have sense, but I think have one error.
Trying to correct:
$date = new Zend_Date();
$date-setTimezone('UTC');
$date-set($dbRow-date, '-MM-dd HH:mm:ss');
$nowDate = new Zend_Date();
$nowDate-setTimezone('UTC');
$timeSlice = $nowDate-subDate($date);
Саша Стаменковић a écrit :
First example is very comfusing, 2nd have sense, but I think have one
error. Trying to correct:
$date = new Zend_Date();
$date-setTimezone('UTC');
$date-set($dbRow-date, '-MM-dd HH:mm:ss');
$nowDate = new Zend_Date();
$nowDate-setTimezone('UTC');
$timeSlice =