Bug in lsParseDateTime()

Description

This is copied from: https://issues.jboss.org/browse/RAILO-3312

Works in CF, errors in Railo with:

can't cast [2011-03-24] to date value

My locale is english (uk)

I don't if yyyy-mm-dd should be a valid format for my locale, if it's not, this is just a CF compat issue.

Environment

None

Attachments

1

Activity

Pothys - MitrahSoft 11 September 2020 at 08:08

, I agreed with your comment as per above PR conversation.

Pothys - MitrahSoft 6 July 2020 at 15:19

I've added a fix for this ticket

Pull Request: https://github.com/lucee/Lucee/pull/978

Adam Cameron 1 November 2016 at 20:23

Hi
Thanks for looking at this. As you know, I don't use CFML any more, so for issues I've raised in the past... it's OK just to close them as "yeah, thanks for letting us know". I would not want you to invest your time in looking at the issues I've raised.

I note five ppl have "watched" this (I'm one), but no-one's voted, so I dunno if anyone else really is that concerned about this?

Perhaps the easiest remedial action is just to document it as an "ColdFusion incompatibility edge-case".

Cheers for looking at it though dude.

Michael Offner 1 November 2016 at 20:12

lsParseDateTime simply uses SimpleDateFormat (https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html) in the back, used with the "uk" locale this can simply not handle this format.
What supports this format is the "us" locale, so when i do this [lsParseDateTime("2011-03-24","english (us)")] it works.

I assume that ACF uses the "US" locale as fallback in case the defined locale is not working. I'm not sure if this is a smart solution because this could lead to unexpected results.

An other reason could be that this format is supported depending on the JVM version used.

Andrew Dixon 17 April 2016 at 20:24

Testcase fails on Lucee with:

but passes on ACF-11.

Fixed

Details

Assignee

Reporter

Priority

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

Sprint

Created 1 February 2015 at 15:37
Updated 3 February 2021 at 18:37
Resolved 11 September 2020 at 08:01