Title:
[ANeff] Bug for: IsDate()/ParseDateTime() vs LSIsDate()/LSParseDateTime wrt DateTimeObject and ISO8601
| View in TrackerStatus/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: