-
Notifications
You must be signed in to change notification settings - Fork 800
Fix DateObject->subMonth() bug related to non-UTC timezones #693
base: master
Are you sure you want to change the base?
Fix DateObject->subMonth() bug related to non-UTC timezones #693
Conversation
@kylehendricks Please check the failure on Travis: https://travis-ci.org/zendframework/zf1/jobs/129276932#L498 |
@kylehendricks |
@froschdesign Can the CLA be e-signed? |
No. Print, fill, scan and email it. |
@kylehendricks |
Just sent the CLA, looking into the test failure now. |
@froschdesign I didn't notice all the tests in tests/Zend/DateTest.php so I moved my test into there. I noticed that all the other Zend_Date add/sub month tests had a hidden dependency on the PHP |
Please create a new test method. Thanks! |
@weierophinney |
This purpose of this line is to help see if the day of month (ex: 30th, 31st) exists in the month we are adding/subtracting to. The problem with it is that
mktime
call is taking into account the timezone but thegetDateParts
is not. This will cause problems with times that are "ahead a month" of UTC. (Ex: a +4 timezone at 1 am on the first of a month). We first convert from local timezone to UTC with themktime
,getDateParts
is then called which returns a UTC time. We need the resulting "overflow" time to be in the local timezone.