Title:
Bug 84582:DateConvert() didn’t do the conversions right at DST change boundaries
| View in TrackerStatus/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: