tracker issue : CF-4207741

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

Incorrect Date Calculation When Using DateDiff()

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/Duplicate

Reporter/Name(from Bugbase): Dave L. / ()

Created: 03/31/2020

Components: Language, DateTime Functions

Versions: 2016

Failure Type: Data Corruption

Found In Build/Fixed In Build: ALL /

Priority/Frequency: Normal / All users will encounter

Locale/System: English / Windows 10 64 bit

Vote Count: 0

Problem Description:
ColdFusion improperly calculates the difference between two dates if the date is before 1970.

Steps to Reproduce:
writeDump( dateDiff( 'd', '6/1/1420', '12/31/1967' ) );

Actual Result:

Expected Result:

Any Workarounds:
Lucee 4.5 and 5.0 get the date math right. Perhaps they are using a different Java date math library?