I am actually going through the utility class Calender. I find myself confused with,
The methods
getFirstDayOfWeek()
returns the first day of the week;
e.g., SUNDAY in the U.S., MONDAY in France.
and
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.
I am living in India (UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi. Daylight Saving time is not observed in this time zone.
To get the Week of the year, i coded like this
Calendar calendar = Calendar.getInstance();
System.out.println(calendar.get(Calendar.WEEK_OF_YEAR)); // returns 45
45 is only possible if Java treats
WeekNumber FromDate ToDate
Week 01 December 30, 2013 January 5, 2014 // December 30 is Monday
Week 45 November 3, 2014(Monday) November 9, 2014
Does Java takes minimal days to be a full week to be 7? Because I can change it through setMinimalDaysInFirstWeek(). And what effect will it have?