Hello,
I am trying to subtract a date from another one.
Sample data:
2011-07-02 ____ 2011-01-01
2010-07-02 ____ 2010-01-01

Method:
$diff = $return->getDate()->subDate($going->getDate())->toArray();

Output for 2011-07-02 ____ 2011-01-01 :
    [day] => 31
    [month] => 5
    [year] => 0
    [hour] => 23
    [minute] => 00
    [second] => 00
    [timezone] => EEST
    [timestamp] => -62154270000
    [weekday] => 6
    [dayofyear] => 151
    [week] => 22
    [gmtsecs] => 7200


Output for 2010-07-02 ____ 2010-01-01:

    [day] => 1
    [month] => 6
    [year] => 0
    [hour] => 23
    [minute] => 00
    [second] => 00
    [timezone] => EEST
    [timestamp] => -62154183600
    [weekday] => 7
    [dayofyear] => 152
    [week] => 23
    [gmtsecs] => 7200



I am trying to understand why it differs when the dates are in 2011.
The difference in 2010 is 6 months whereas it is 5 months in 2011.
Any idea something wrong? Not considering a point?

Thanks,
adda sc

Reply via email to