Lucee 6.2 Fails to convert javascript date

This code fails with error
Can't cast String [December, 18 2023 00:00:00 -0600] to a value of type [datetime]

	function dt(){
		var str = "December, 18 2023 00:00:00 -0600";
		var date = dateFormat(str, "short");
	}

Found in Lucee 6.2.0+321

The workaround is

parseDateTime(str, "mmmm, d yyyy HH:nn:ss Z");

As we have a RC for 6.2.1, I’d suggest avoiding wasting your time with 6.2.0 discovering potentially resolved tech debt…

I thought it might be helpful to document this gotcha for anyone looking to implement 6.2.0
I’m not going to put an RC in production, so we’re stuck with 6.2.0 for now.

Also found 6.2.0 doesn’t parse this version of a date either:
Thu Apr 10 2025 16:00:15 GMT-0500 (Central Daylight Time)

both pass with 6.2.1, I’ve updated the test cases to include them

image

1 Like

With that in mind, I’m looking forward to 6.2.1!

1 Like