tracker issue : CF-4202449

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

[ANeff] Bug for: IsDate()/ParseDateTime() vs LSIsDate()/LSParseDateTime wrt DateTimeObject and ISO8601

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/BugVerified

Reporter/Name(from Bugbase): Aaron Neff / ()

Created: 05/16/2018

Components: Language, Functions

Versions: 2016

Failure Type: Incorrectly functioning

Found In Build/Fixed In Build: 2018.0.01.308605 (PreRelease) / 2018,0,0,309596

Priority/Frequency: Normal / Few users will encounter

Locale/System: English / Platforms All

Vote Count: 0

Issues: IsDate()/ParseDateTime() vs LSIsDate()/LSParseDateTime wrt DateTimeObject and ISO8601

Issue 1 (LSParseDateTime doesn't honor DateTimeObject):

<cfscript>
  myDateTime = createDate(2018,1,1)
  writeOutput(isDate(myDateTime) & '<br>' & lsIsDate(myDateTime) & '<br>' & parseDateTime(myDateTime))
  try {
    writeOutput('<br>' & lsParseDateTime(myDateTime))
  }
  catch(any e) {writeOutput('<br>' & e.message)}
</cfscript>

Actual Result 1:
YES
YES
{ts '2018-01-01 00:00:00'}
{ts '2018-01-01 00:00:00'} is an invalid date or time string.

Expected Result 1:
YES
YES
{ts '2018-01-01 00:00:00'}
{ts '2018-01-01 00:00:00'}

Note 1: DateTimeObject should always be honored/parsable as a date (especially since LSIsDate() returns true).

Issue 2:

<cfscript>
  myDateTime = createDate(2018,1,1).dateTimeFormat("iso")
  writeOutput(isDate(myDateTime) & '<br>' & lsIsDate(myDateTime) & '<br>' & parseDateTime(myDateTime))
  try {
    writeOutput('<br>' & lsParseDateTime(myDateTime))
  }
  catch(any e) {writeOutput('<br>' & e.message)}
</cfscript>

Actual Result 2:
YES
NO
{ts '2018-01-01 00:00:00'}
2018-01-01T00:00:00-05:00 is an invalid date or time string.

Expected Result 2:
YES
YES
{ts '2018-01-01 00:00:00'}
{ts '2018-01-01 00:00:00'}

Note 2: ISO8601 is the international standard for representing date/time and should always be honored/parsable as a date.

Attachments:

Comments:

Related thread: https://forums.adobeprerelease.com/coldfusionpr/discussion/404/cf-4165524-datetime-functions-return-incorrect-inconsistent-results
Comment by Aaron N.
27826 | May 16, 2018 03:13:43 AM GMT
Hi Adobe, I've confirmed this issue also exists in CF2016u1 and CF2016u5. Thanks!, -Aaron
Comment by Aaron N.
27830 | May 17, 2018 04:38:07 AM GMT