lsParseDateTime() produces different results in Lucee vs ACF

Description

This is the example I tried:

<cfset timeStamp = "2018-01-04-23.40.56"> <cfset newTimeStamp = lsParseDateTime(timeStamp, "en", "yyyy-MM-dd-HH.mm.ss")> <cfoutput>#newTimeStamp#</cfoutput>

According to http://cflive.net:
Lucee produces the correct output:

{ts '2018-01-04 23:40:56'}

But ACF gives incorrect result:

{ts '2021-04-04 23:00:56'}

When I change the pattern to

"yyyy-MM-dd-HH.nn.ss"

(using "nn" for minutes)

Then Lucee throws an error:

Lucee 5.1.3.18 Error (java.lang.IllegalArgumentException) Message Illegal pattern character 'n' Cause java.lang.IllegalArgumentException

While ACF works correctly:

{ts '2018-01-04 23:40:56'}

Activity

Show:

Pothys - MitrahSoft 22 January 2018 at 14:04

I've confirmed LsParseDateTime() working differs from ACF. After the confirmation from I'll update the status in this ticket.

Marianna Shvartsapel 19 January 2018 at 15:03

Hi Pothys,

thanks for looking into this.

Yes, I know. That's why I files this as an "Incompatibility" issue.

According to ACF docs here https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-l/lsparsedatetime.html

"mm is deprecated. Use nn for minutes" which will cause incompatibility between Lucee and ACF.

Pothys - MitrahSoft 19 January 2018 at 07:06

Hi ,

I've analyzed this ticket & confirmed the issue happened. But Lucee doesn't support for "nn" format. Please see Documentation here "http://docs.lucee.org/reference/functions/lsparsedatetime.html". Lucee works fine with "mm" for "Minute in hour". Using "mm" is correct format in lucee.

Details

Assignee

Reporter

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Affects versions

Priority

Created 11 January 2018 at 22:35
Updated 9 September 2019 at 14:14

Flag notifications