tracker issue : CF-4014660

select a category, or use search below
(searches all categories and all time range)

LSDateFormat and DateFormat parse date strings differently

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): John Whish / John Whish (John Whish)

Created: 06/30/2015

Components: Core Runtime

Versions: 10.0

Failure Type:

Found In Build/Fixed In Build: Final /

Priority/Frequency: Normal / Unknown

Locale/System: English / Platforms All

Vote Count: 4

Listed in the version 2016.0.0.297996 Issues Fixed doc
Verification notes: verified_fixed on August 06, 2017 using build 2016.0.01.298513
Problem Description:

LSDateFormat and DateFormat parse date strings differently. They should be consistent. Have search bugbase and not found the issue reported previously.

Steps to Reproduce:

foo = "{ts '2015-01-09 15:15:39'}";
writeDump(isDate(foo)); // true
writeDump(DateFormat(foo, "yyyy-mm-dd")); // 2015-01-09
writeDump(LSDateFormat(foo, "yyyy-mm-dd")); // error 

Actual Result:

LSDateFormat(foo, "yyyy-mm-dd")) returns: 
{ts '2015-06-30 16:16:31'} is an invalid date format

Expected Result:

I would expect it to work the same for all 3 functions. Either it's a date value that can be parsed or not. It shouldn't only error on LSDateFormat.

Any Workarounds:

use parseDateTime("{ts '2015-06-30 16:16:31'}")

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4014660

External Customer Info:
External Company:  
External Customer Name: John
External Customer Email:  
External Test Config: My Hardware and Environment details:

Tested on ColdFusion 10 and 11

First seen on ColdFusion 10 Mac OSX



The family of functions should accept the same set of strings. It seems unintuitive to remember what functions parse what date things and what ones don't. Please fix.
Vote by External U.
6823 | June 30, 2015 11:12:44 AM GMT
Ugh. Can't all the xxDatexx() functions just get along? :-/
Vote by External U.
6824 | June 30, 2015 11:39:39 AM GMT
Vote by External U.
6825 | June 30, 2015 12:30:10 PM GMT
If a value passes an isDate() check, it must then be able to be used in any situation that expects a date.
Vote by External U.
6826 | July 04, 2015 05:47:09 PM GMT
Fix verified in build: 295738 Platform checked on: Win7 x64 Test case used: //depot/qa/cf/regression/coretests/coldfusion/functions/date-time/lsdatediff/
Comment by Kailash B.
6821 | September 25, 2015 01:06:10 AM GMT
Verified this is fixed in CF2016 Update 1 (build 2016.0.01.298513). Also: Issue didn't affect the member function; only the BIF. Odd. Thanks!, -Aaron
Comment by Aaron N.
6822 | August 06, 2017 12:04:11 AM GMT