Status/Resolution/Reason: Closed/Fixed/Fixed
Reporter/Name(from Bugbase): Shawn Oden / Shawn Oden (Shawn Oden)
Created: 10/04/2016
Components: Language, DateTime Functions
Versions: 2016
Failure Type: Unspecified
Found In Build/Fixed In Build: CF2016_Final / 302324
Priority/Frequency: Trivial / All users will encounter
Locale/System: English / Win 64
Vote Count: 1
Problem Description: The DateFormat() and DateTimeFormat() functions return inconsistent values based on the capitalization of the mask.
Steps to Reproduce:
n = createDateTime(2015,12,30,11,22,33);
ds = {
df : dateFormat(n,"MM/DD/YYYY") ,
dtf : dateTimeFormat(n,"MM/DD/YYYY")
} ;
writeDump(ds);
http://trycf.com/gist/f83f2e4f2012f2df08c30e5892d8db9c/acf2016?theme=monokai
Actual Result:
DF = 12/30/2015
DTF = 12/364/2016
Expected Result:
I would expect the results to match. They should probably both be similar to Java SimpleDateFormat, since that seems to be the masking that DateTimeFormat() mostly follows, ie don't allow upper- and lower-case masks in DateFormat()..
Any Workarounds:
Use lowercase masks for both, and verify that the date position masks don't introduce unexpected behavior.
In these situations, larger caution for developers may be warranted on the docs pages.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4194962
External Customer Info:
External Company:
External Customer Name: Shawn Oden
External Customer Email:
External Test Config: My Hardware and Environment details: Windows 7 Professional 64-bit with ColdFusion 2016 Update 3 Express Edition.
Attachments:
Comments: