Re: [fw-general] How to get the number of day between 2 date

2009-08-13 Thread Thomas Weidner
$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

Re: [fw-general] How to get the number of day between 2 date

2009-08-13 Thread 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

[fw-general] How to get the number of day between 2 date

2009-08-12 Thread Mathieu Suen
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 --

Re: [fw-general] How to get the number of day between 2 date

2009-08-12 Thread Саша Стаменковић
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

Re: [fw-general] How to get the number of day between 2 date

2009-08-12 Thread Mathieu Suen
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

Re: [fw-general] How to get the number of day between 2 date

2009-08-12 Thread Саша Стаменковић
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);

Re: [fw-general] How to get the number of day between 2 date

2009-08-12 Thread Mathieu Suen
Саша Стаменковић 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 =