tracker issue : CF-4126482

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

DateDiff is non-zero for two dates that are the same

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/AsDesigned

Reporter/Name(from Bugbase): A. Bakia / A. Bakia (A. Bakia)

Created: 03/09/2016

Components: Language

Versions: 10.0

Failure Type: Unspecified

Found In Build/Fixed In Build: Beta2_v12 /

Priority/Frequency: Normal / Unknown

Locale/System: English / Win All

Vote Count: 0

Problem Description: The function dateDiff results in -3600 seconds for two dates that are the same.

Steps to Reproduce:
<cfset utcDate1 = dateConvert("local2Utc", now()) />
<cfset utcDate2 = dateAdd( "s", getTimeZoneInfo().UTCTotalOffset, now()) />
    <cfoutput>
        <pre>
        UTC Date:                #utcDate1# 
        
        Alternative UTC Date: 	 #utcDate2# 
        
        Difference in UTC dates: #dateDiff("s", utcDate1, utcDate2)# seconds
        </pre>
    </cfoutput>


Actual Result: The output shows the dates utcDate1 and utcDate2 to be the same, to the last second. But the dateDiff results in -3600 seconds.

Expected Result:
I expected the dateDiff to result in 0 seconds.

Any Workarounds:

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

Watson Bug ID:	4126482

External Customer Info:
External Company: (withheld for privacy)
External Customer Name: A. Bakia
External Customer Email: A.BAKIG@CHELLO.NL
External Test Config:

Attachments:

Comments:

Adding BUG AUDIT TRAIL ********action: updated fieldName: Priority newValue: 2 oldValue: 0 oprid: vmannebo recordName: RQ_DEFECT timpestamp: 2016-02-16 04:57:14.0 action: updated fieldName: Owner newValue: awdhesh oldValue: inoel oprid: inoel recordName: RQ_DEFECT timpestamp: 2016-01-07 05:04:05.0 action: updated fieldName: Fix By Product Milestone newValue: Alpha oldValue: Blank oprid: inoel recordName: RQ_DEFECT timpestamp: 2016-01-07 05:04:05.0 action: updated fieldName: Reason newValue: Blank oldValue: Blank oprid: inoel recordName: RQ_DEFECT timpestamp: 2016-01-07 05:04:05.0 action: updated fieldName: Status newValue: ToFix oldValue: Unverified oprid: inoel recordName: RQ_DEFECT timpestamp: 2016-01-07 05:04:05.0 action: updated fieldName: Fix By Milestone newValue: Alpha oldValue: Blank oprid: inoel recordName: RQ_DEFECT timpestamp: 2016-01-07 05:04:05.0
Comment by CFwatson U.
4001 | March 09, 2016 02:16:14 AM GMT
Added By: PreRelease User User Name:A. Bakia Note Added: Entered Bug. Date Added :2016-01-03 20:38:00.0
Comment by CFwatson U.
4002 | March 09, 2016 02:16:15 AM GMT
These are my findings: dateConvert() function actually converts the date from the local timezone to the UTC timezone dateAdd() function just adds a delta to the given time without changing the timezone. Hence, although the date-time objects utcDate1 and utcDate2 look the same (because of the same numerical value) but they belong to different timezones and the datediff() function takes care of the timezone difference as well
Comment by Nikhil S.
4003 | August 12, 2016 05:36:49 AM GMT