tracker issue : CF-3739355

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

CFCLIENT: dateFormat : format does not work when used without any delimited in between

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): / ext-user (Anuj Nawani)

Created: 04/09/2014

Components: Mobile Support, Data Structure

Versions: 11.0

Failure Type:

Found In Build/Fixed In Build: 289685 / CF11 Update5

Priority/Frequency: Minor / All users will encounter

Locale/System: English / Windows 7 64-bit

Vote Count: 0

Related Bugs:
CF-4092089 - Similar to


Code snippet:

<div>
<cfclient>
<cfset d="2003-6-11 10:50:32">
<cfoutput>#dateFormat(d, "yyyy/mm/dd 20d")#</cfoutput>
</cfclient>
</div>

Expected: 2011
Actual: 20d

Same issue with other formats: gg, h, m, s, y

When we use some delimiter like comma, space, colon etc it works fine e.g.
<cfoutput>#dateFormat(d, "20 d")#</cfoutput>

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

Watson Bug ID:	3739355

External Customer Info:
External Company:  
External Customer Name:  
External Customer Email:

Attachments:

Comments:

Chrome this is working fine, but getting the following output in Mozilla and IE: NaN/NaN/NaN 20NaN (Comment added from ex-user id:prk)
Comment by Adobe D.
12749 | January 19, 2015 07:37:24 AM GMT
Issue is with mozilla browser not being able to parse given string as date. Workaround is to use cf function like createDateTime(2003,6,11,10,50,32) and pass the date object to dateFormat. (Comment added from ex-user id:sandeepp)
Comment by Adobe D.
12750 | January 30, 2015 06:52:05 AM GMT
Getting the correct output in mozilla, IE and safari when using the createDateTime cffunction (Comment added from ex-user id:prk)
Comment by Adobe D.
12751 | February 10, 2015 11:11:39 PM GMT
The fix for this bug is available in the pre-release build of ColdFusion 11 Update 5
Comment by CFwatson U.
12752 | February 20, 2015 09:28:03 AM GMT
Adobe, This is not fixed. It is fixed in Chrome (v46.0.2490.86 m). It is not fixed in Firefox (v42). It is not fixed in Internet Explorer (v11). For the code in the description, Chrome displays: 2003/06/11 2011 (good) FF & IE display: NaN/NaN/NaN 20NaN (bad) Thanks!, -Aaron
Comment by External U.
12753 | November 23, 2015 10:13:03 PM GMT
Adobe, This ticket is not Closed/Fixed b/c this ticket is for dateFormat() (not createDateTime()). Either dateFormat() needs to be fixed or needs to be documented as not working on FF/IE. Thanks!, -Aaron
Comment by External U.
12754 | November 23, 2015 10:19:54 PM GMT
Thanks Aaron. We will get this behavior documented as dateFormat function has an issue in Firefox and IE. Bug(#CF-4092089) has been logged for the same. (Comment added from ex-user id:prk)
Comment by Adobe D.
12755 | November 25, 2015 01:21:05 AM GMT
Hi Priyatharsini, You're very welcome! I see parseDateTime() also doesn't always work in IE/FF but works in Chrome (filed as CF-4094689). Thanks!, -Aaron
Comment by External U.
12756 | December 02, 2015 05:46:54 AM GMT