Highlighted

parseDateTime behaviour change in CF11?

New Here ,
Aug 04, 2014

Copy link to clipboard

Copied

Hi,

I'm just working on Migration CF10 -> CF11 and reallized that some figures are display like date.

So check and the debugging ends on that:

CF 10 :

parseDateTime("2000") => Exception "2000 is an invalid date or time string."

CF 11:

parseDateTime("2000") => {ts '2000-01-01 00:00:00'}

Sound really strange.

Regards.

More experimentation in CF11:

parseDateTime("999") => Exception "999 is an invalid date or time string."

parseDateTime("0999") => {ts '0998-12-27 00:00:00'}

parseDateTime("1000") => {ts '0999-12-27 00:00:00'}

parseDateTime("1582") => {ts '1581-12-22 00:00:00'}

parseDateTime("1583") => {ts '1583-01-01 00:00:00'}

...

Views

305

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

parseDateTime behaviour change in CF11?

New Here ,
Aug 04, 2014

Copy link to clipboard

Copied

Hi,

I'm just working on Migration CF10 -> CF11 and reallized that some figures are display like date.

So check and the debugging ends on that:

CF 10 :

parseDateTime("2000") => Exception "2000 is an invalid date or time string."

CF 11:

parseDateTime("2000") => {ts '2000-01-01 00:00:00'}

Sound really strange.

Regards.

More experimentation in CF11:

parseDateTime("999") => Exception "999 is an invalid date or time string."

parseDateTime("0999") => {ts '0998-12-27 00:00:00'}

parseDateTime("1000") => {ts '0999-12-27 00:00:00'}

parseDateTime("1582") => {ts '1581-12-22 00:00:00'}

parseDateTime("1583") => {ts '1583-01-01 00:00:00'}

...

Views

306

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Aug 04, 2014 0
Adobe Community Professional ,
Aug 05, 2014

Copy link to clipboard

Copied

Coldfusion is a weakly-typed language, with the result that it can only guess the type from certain internal rules. For example, it may not see "2014" (the current year) as a valid datetime, but it does "2a".

The error message you received contains a hint. First, call isDate() or isValid() on a string to determine whether or not it represents a valid datetime. If it does, then perform parseDatetime().

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 05, 2014 0
New Here ,
Aug 12, 2014

Copy link to clipboard

Copied

I fully agree, but I've analysed the migration effort using this information: Changes in ColdFusion - ColdFusion English Documentation - Adobe Learning Resources and this modification is not listed.

Where can I found the CF11 bug list?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 12, 2014 0
Adobe Community Professional ,
Aug 12, 2014

Copy link to clipboard

Copied

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 12, 2014 0