Status/Resolution/Reason: To Fix//
Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)
Created: 01/04/2016
Components: Language
Versions: 11.0
Failure Type: Enhancement Request
Found In Build/Fixed In Build: CF11_Final /
Priority/Frequency: Trivial / Unknown
Locale/System: English / Win All
Vote Count: 1
The dateTimeFormat() doc links to the SimpleDateFormat doc for the complete list of masks. SimpleDateFormat supports the "Y" (ISO week year) mask as of Java 7.
Issue: dateFormat() and dateTimeFormat() don't support the "Y" mask.
Example:
<cfscript>
dateTime = createDate(2016,1,3);
locale = createObject("java", "java.util.Locale").init("en", "GB");
sdf = createObject("java", "java.text.SimpleDateFormat").init("Y", locale);
writeOutput(sdf.format(dateTime));//returns 2015 (good)
setLocale("en_GB");
writeOutput(dateTimeFormat(dateTime, "Y"));//returns 2016 (bad)
</cfscript>
Actual output: 20152016
Expected output: 20152015
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4103427
External Customer Info:
External Company:
External Customer Name: Aaron Neff
External Customer Email:
Attachments:
Comments: