tracker issue : CF-4105828

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

dateTimeFormat("YYYY") increments year for dates between December 27 and December 31

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Alexander Kwaschny / Alexander Kwaschny (Alexander Kwaschny)

Created: 01/11/2016

Components: Documentation, General

Versions: 10.0

Failure Type:

Found In Build/Fixed In Build: Final /

Priority/Frequency: Normal / Some users will encounter

Locale/System: English / Win 2008 Server R2 64 bit

Vote Count: 2

Problem Description:

The dateTimeFormat function returns an incremented year value when using the uppercase year mask when the date to format lies between December 27 and December 31.

Steps to Reproduce:

<cfset december26_lastYear = createDate(2015, 12, 26)>
<cfset december27_lastYear = createDate(2015, 12, 27)>


	#dateTimeFormat(december26_lastYear, "YYYY")#<br>
	<!--- >> 2015 --->

	#dateTimeFormat(december26_lastYear, "yyyy")#<br>
	<!--- >> 2015 --->

	#dateTimeFormat(december27_lastYear, "YYYY")#<br>
	<!--- >> 2016 --->

	#dateTimeFormat(december27_lastYear, "yyyy")#<br>
	<!--- >> 2015 --->


Actual Result:
See comments in example.

Expected Result:
As long as the uppercase YYYY mask is not documated differently, I expect it to work the same way as the lowercase yyyy mask.

Any Workarounds:
Not using uppercase letters for the year mask.

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

Watson Bug ID:	4105828

External Customer Info:
External Company:  
External Customer Name: Alexander Kwaschny
External Customer Email:  
External Test Config: Adobe ColdFusion Server Enterprise on Windows Server 2008 R2 Enterprise

TimeZone is CET.



Confirmed on CF11 as well
Vote by External U.
4904 | January 11, 2016 06:37:18 AM GMT
Affects lsdateTimeFormat as well. #lsdateTimeFormat(december27_lastYear, "YYYY") // returns 2016
Comment by External U.
4900 | January 11, 2016 06:56:02 AM GMT
Affects lsdateTimeFormat as well. #lsdateTimeFormat(december27_lastYear, "YYYY") // returns 2016
Vote by External U.
4905 | January 11, 2016 06:56:09 AM GMT
Not a bug I'm afraid. "Y" is not the same as "y": y = calendar year Y = week year Part of the last week of December can fall in week 1 of the following year. I think Adobe should perhaps document this a bit better than just footnoting that SimpleDateFormat character also work in dateTimeFormat().
Comment by External U.
4901 | January 11, 2016 07:37:13 AM GMT
Alexander, This is not a bug, as Adam said in the previous comment. This information needs to be updated in the documentation. I am forwarding it to the concern team. Thanks, Nimit
Comment by Nimit S.
4902 | February 12, 2016 01:23:27 AM GMT
Documentation has been updated with the latest information.
Comment by Nimit S.
4903 | February 26, 2016 05:37:24 AM GMT