我实际上正在通过实用程序类日历。我发现自己很困惑,
方法
getFirstDayOfWeek()
returns the first day of the week;
e.g., SUNDAY in the U.S., MONDAY in France.
和
getMinimalDaysInFirstWeek()
returns the minimal days required in the first week of the year. e.g.,
if the first week is defined as one that contains the first day of the
first month of a year, this method returns 1. If the minimal days required
must be a full week, this method returns 7.
我住在印度 (UTC+05:30) 钦奈、加尔各答、孟买、新德里。该时区不实行夏令时。
为了获得一年中的一周,我这样编码
Calendar calendar = Calendar.getInstance();
System.out.println(calendar.get(Calendar.WEEK_OF_YEAR)); // returns 45
45 只有在 Java 处理时才有可能
WeekNumber FromDate ToDate
Week 01 December 30, 2013 January 5, 2014 // December 30 is Monday
Week 45 November 3, 2014(Monday) November 9, 2014
Java 需要最少几天才能变成一整周才能变成 7 天吗?因为我可以通过 setMinimalDaysInFirstWeek() 来改变它。又会有什么影响?