昨天正好在微博上看到有个提到了这个问题
YYYY和yyyy在时间的计算上是有点区别的
It uses yyyy to specify the year component. A common mistake is to use YYYY. yyyy specifies the calendar year whereas YYYY specifies the year (of “Week of Year”), used in the ISO year-week calendar. In most cases, yyyy and YYYY yield the same number, however they may be different. Typically you should use the calendar year.
年份如果用大Y会是这周的年份,小y才是标准的年份 例如2013年12月29号开始,如果用大Y的话就是2014年的第一周了,年份会转成2014
yyyy和YYYY只有在年末那几天会有所不同 就楼上说的29号的问题。
If 1 January is on a Monday, Tuesday, Wednesday or Thursday, it is in week 01. If 1 January is on a Friday, Saturday or Sunday, it is in week 52 or 53 of the previous year (there is no week 00). 28 December is always in the last week of its year.
如果1月1号是周1到周四 那么这一周就算是这一年的第一周 反之则算到上一年。
所以从29号-31号都属于2014年的第一周