tracker issue : CF-4201527

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

Can't add 2 hours to a date object created with CreatDate()

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/UserError

Reporter/Name(from Bugbase): Jack Drysdale Jr / Jack Drysdale Jr ()

Created: 03/13/2018

Components: Language, DateTime Functions

Versions: 10.0

Failure Type: Data Corruption

Found In Build/Fixed In Build: 10,0,20,299202 /

Priority/Frequency: Normal / All users will encounter

Locale/System: ALL / Windows 10

Vote Count: 0

Problem Description:  I cannot add two hours to a date object created with CreateDate(y,m,d).  I can add one hour, I can add three hours, I can add four hours, but two hours will display as if three hours were added.

Steps to Reproduce:
<cfset aDate = CreateDate(2018,3,11) />
<cfset bDate = DateAdd('h',2,aDate) />
<cfset cDate = DateAdd('n',120,aDate) />
<cfset dDate = DateAdd('s',7200,aDate) />
<cfset zDate = DateAdd('h',4,aDate) />
<cfoutput>
     #aDate# <!--- Will display as {ts'2018-03-11 00:00:00'} --->
     #bDate# <!--- Will display as {ts'2018-03-11 03:00:00'} --->
     #cDate# <!--- Will display as {ts'2018-03-11 03:00:00'} --->
     #dDate# <!--- Will display as {ts'2018-03-11 03:00:00'} --->
     #zDate# <!--- Will display as {ts'2018-03-11 04:00:00'} --->
</cfoutput>

Actual Result:
See "Steps to reproduce".

Expected Result:
Adding two hours to display as {ts'2018-03-11 02:00:00'}.

Any Workarounds:
None.

Attachments:

Comments:

This can be deleted. I know, now, that the issue is because of DST. The date/time that I'm trying to acquire doesn't exist (2am 11 MAR 2018 is when the clocks jump ahead one hour, so 2am doesn't exist - it becomes 3am.)
Comment by Jack D.
69 | March 13, 2018 07:12:08 PM GMT