tracker issue : CF-3042791

select a category, or use search below
(searches all categories and all time range)
Title:

Bug 85085:(Watson Migration Closure)DateConvert() gives incorrect results during a one hour period once a year if OS is set to a time zone that observes Daylight Saving Time

| View in Tracker

Status/Resolution/Reason: Closed/Won't Fix/LowImpact

Reporter/Name(from Bugbase): Alex B / Alex B (lx_devr)

Created: 11/17/2010

Components: Language, Functions

Versions: 9.0.1

Failure Type: Unspecified

Found In Build/Fixed In Build: 9,0,1,274733 /

Priority/Frequency: Normal / Unknown

Locale/System: English / Win All

Vote Count: 2

Problem:

DateConvert() gives incorrect results during a one hour period once a year if OS is set to a time zone that observes Daylight Saving Time.This bug is apparently known to Adobe (see http://www.bennadel.com/blog/1596-Converting-To-And-From-GMT-UTC-Time-In-ColdFusion-Using-DateConvert-.htm#comments_31649) but I can't find a report here in cfbugs or any references to it in known issues:9.0.1: http://kb2.adobe.com/cps/849/cpsid_84902.html9: http://www.adobe.com/support/documentation/en/coldfusion/9/cf9_releasenotes.pdf8.0.1: http://www.adobe.com/support/documentation/en/coldfusion/801/cf801releasenotes.pdf8: http://www.adobe.com/support/documentation/en/coldfusion/8/releasenotes.pdfI want to vote on the bug and I think other CF developers would benefit from having the bug documented, so here it is.DateConvert() improperly performs a daylight saving adjustment on UTC, which does not observe Daylight Saving Time.  The adjustment is only applied during a one hour time span close to (but not at) the beginning of Daylight Saving Time in the local time zone.  The erroneous adjustment occurrs a number of hours before or after the beginning of Daylight Saving Time in the local time zone, corresponding to that time zone's offset.Another way of describing the same phenomenon is that ColdFusion seems to treat the UTC input to DateConvert() as a local time.  If local Daylight Saving Time begins at "March 13, 2011 2:00 AM", then ColdFusion seems to automatically change any "March 13, 2011 2:00 AM" to "March 13, 2011 3:00 AM", since they are equivalent in the local time zone.  Unfortunately it does this even when "March 13, 2011 2:00 AM" is the UTC input for the utc2local conversion of DateConvert().
Method:

1] Set server time zone to a time zone that observes Daylight Savings Time.  E.g., Eastern Time (US/Canada).2] Restart ColdFusion so it recognizes the OS time zone.utc2local:3] Determine the time when *local* Daylight Saving Time begins for a particular year.  E.g., March 13, 2011 2:00 AM for Eastern Time (US/Canada).4] Use that time as the input for DateConvert("utc2local", utcDate), which will produce a result which is one hour later than it should be.  E.g., DateConvert("utc2local","3/13/2011 2:00") will produce {ts '2011-03-12 22:00:00'} when the correct result would be {ts '2011-03-12 21:00:00'}.local2utc:5] Determine the offset from UTC for the local timezone during standard time.  E.g., 5 hours for Eastern Time (US/Canada).6] Subtract the UTC hour offset from the beginning of Daylight Saving time to generate a local time that DateConvert will handle incorrectly.  E.g., March 12, 2011 9:00 PM for Eastern Time (US/Canada).7] Use that time as the input for DateConvert("local2utc", localDate), which will produce a result which is one hour later than it should be.  E.g., DateConvert("local2utc","3/12/2011 21:00") will produce {ts '2011-03-13 03:00:00'} when the correct result would be {ts '2011-03-13 02:00:00'}.Additional notes:Observed in CF 9.0.1 and CF 8.0.1, but not in CF 7.0.2.  There is a different, but similar, DateConvert() bug in CF 7 according to (http://www.bennadel.com/blog/1596-Converting-To-And-From-GMT-UTC-Time-In-ColdFusion-Using-DateConvert-.htm#comments_31649).The bug occurs for an hour long period from March 13, 2011 2:00 AM *UTC*  to  March 13, 2011 2:59 AM *UTC* when the local time zone is Eastern Time (US/Canada).It seems to occur for all years.  Other dates in UTC (always 5 hours before local Daylight Saving Time begins) that result in an incorrect result when the local time zone is Eastern Time (US/Canada) include:2005-04-03 02:00 UTC  to  2005-04-03 02:59 UTC2006-04-02 02:00 UTC  to  2006-04-02 02:59 UTC2007-03-11 02:00 UTC  to  2007-03-11 02:59 UTC2008-03-09 02:00 UTC  to  2008-03-09 02:59 UTC2009-03-08 02:00 UTC  to  2009-03-08 02:59 UTC2010-03-14 02:00 UTC  to  2010-03-14 02:59 UTC2011-03-13 02:00 UTC  to  2011-03-13 02:59 UTC2012-03-11 02:00 UTC  to  2012-03-11 02:59 UTCThe bug occurs with other time zones that observe Daylight Saving Time.  I haven't tested every time zone, but some examples for the year 2011 are:2011-03-13 02:00 UTC  to  2011-03-13 02:59 UTC when local time zone is Eastern Time (US/Canada).  Corresponding local time: 2011-03-12 21:00 EST  to 2011-03-12 21:59 EST2011-03-13 02:00 UTC  to  2011-03-13 02:59 UTC when local time zone is Pacific Time (US/Canada).  Corresponding local time: 3/12/2011 18:00 PST to 3/12/2011 18:59 PST2011-10-02 02:00 UTC  to  2011-10-02 02:59 UTC when local time zone is Adelaide.  Corresponding local time: 2011-10-02 12:30 to 2011-10-02 13:29
Result:

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3042791

External Customer Info:
External Company:  
External Customer Name: Alex B
External Customer Email: 17436E0E4A1C46C9992015A9
External Test Config: 11/17/2010

Attachments:

Comments: