tracker issue : CF-3042405

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

Bug 84582:DateConvert() didn’t do the conversions right at DST change boundaries

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): / Sankaram Tata (Tata M.A.S.B. Sankaram)

Created: 10/07/2010

Components: General Server

Versions: 10.0

Failure Type: Unspecified

Found In Build/Fixed In Build: 274361 / 280444

Priority/Frequency: Major / Most users will encounter

Locale/System: English / Win All

Vote Count: 0

Problem:

DateConvert() didn’t do the conversions right at DST change boundaries.

For example when user is in pacific time(UTC+8),user does date convert on March 13th 6PM PST to UTC --> it results to March 14th 3AM 

ideally it should be March 14th 2AM


Method:

1) Set you PC to DST time zone(Pacific time zone)
2) Run the CFM:


<cfset Variables.testDate = CreateDateTime(2010, 3, 12, 12, 0, 0)> <!---Use this for USA.--->
<!---<cfset Variables.testDate = CreateDateTime(2010, 3, 26, 12, 0, 0)> <!---Use this for Europe.--->--->

testDate - DateConvert of testDate<br>
<cfloop index="Variables.intLoop" from="1" to="96">
	<cfoutput>#Variables.testDate# - #DateConvert("local2Utc", Variables.testDate)#</cfoutput><br>
	
	<cfif Hour(Variables.testDate) EQ 23>
		<!---This will blow up at the end of months but I don't really care because I only need to test at DST changes and those aren't at end of months.--->
		<cfset Variables.testDate = CreateDateTime(Year(Variables.testDate), Month(Variables.testDate), Day(Variables.testDate) + 1, 0, Minute(Variables.testDate), Second(Variables.testDate))>
	<cfelse>
		<cftry> <!---Need this in case we try to create a date/time that doesn't exist due to the "spring forward."--->
			<cfset Variables.testDate = CreateDateTime(Year(Variables.testDate), Month(Variables.testDate), Day(Variables.testDate), Hour(Variables.testDate) + 1, Minute(Variables.testDate), Second(Variables.testDate))>
			
			<cfcatch>
				<cfset Variables.testDate = CreateDateTime(Year(Variables.testDate), Month(Variables.testDate), Day(Variables.testDate), Hour(Variables.testDate) + 2, Minute(Variables.testDate), Second(Variables.testDate))>
			</cfcatch>
		</cftry>
	</cfif>
</cfloop>

Result: output 
Result:

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

Watson Bug ID:	3042405

Deployment Phase:	Release Candidate

External Customer Info:
External Company:  
External Customer Name: Sankaram Tata
External Customer Email: Sankaram
External Test Config: 10/07/2010

Attachments:

Comments:

Hima 14 Sep 2011: Checkin # 275430 has introduced a bug regarding utc2local. Considering the current timezone is PST, <cfoutput>#DateConvert("utc2local", "3/12/2010 2:00")#</cfoutput><br> should give {ts '2010-03-11 18:00:00'} instead of {ts '2010-03-12 2:00:00'} Problem is that the provided date is considered to be in local timezone and so the UTC timestamp is actually of +8 hrs which is wrong. We are converting this erroneous timestamp (instead of the original UTC time given) Fix is to revert the utc2local conversion code in DateUtils.java to Rev#11 Bug fixed by rakshith Bug History Timestamp|name|field|from value|to value| 6 Oct 2010 23:52:27 GMT | Sankaram Tata | Bug Submitted | | | 6 Oct 2010 23:52:27 GMT | Sankaram Tata | Class Type | | BUG | 6 Oct 2010 23:52:27 GMT | Sankaram Tata | Severity | | 3-High (Has workaround difficult to implement) | 6 Oct 2010 23:53:24 GMT | Sankaram Tata | Priority | | A | 6 Oct 2010 23:53:24 GMT | Sankaram Tata | Queue Transfer | | Rakshith | 6 Oct 2010 23:53:24 GMT | Sankaram Tata | Target Fix Milestone | | Alpha 1 | 6 Oct 2010 23:53:24 GMT | Sankaram Tata | Target Fix Release | | ColdFusion 10.0 | 6 Oct 2010 23:53:24 GMT | Sankaram Tata | Verified | No | Yes | 7 Oct 2010 19:05:01 GMT | Rakshith N | Fixed | No | Yes | 7 Oct 2010 19:05:01 GMT | Rakshith N | Queue Transfer | Rakshith | Sankaram | 17 Feb 2011 19:43:09 GMT | Sankaram Tata | Queue Transfer | Sankaram | Himavanth | 7 Sep 2011 22:25:42 GMT | Himavanth Rachamsetty | Closed | No | Yes | 14 Sep 2011 01:56:30 GMT | Himavanth Rachamsetty | Closed | Yes | No | 14 Sep 2011 01:56:30 GMT | Himavanth Rachamsetty | Fixed | Yes | No | 14 Sep 2011 01:56:30 GMT | Himavanth Rachamsetty | Queue Transfer | Himavanth | sandeepp |
Comment by Kunal S.
21386 | November 11, 2011 03:59:05 AM GMT
Test case added in the folder \cfsuite\coldfusion\bugs\ (Comment added from ex-user id:yrr)
Comment by Adobe D.
21387 | February 13, 2012 03:44:00 AM GMT