Calendar.getFirstDayOfWeek()

Date

Calendar.getFirstDayOfWeek() Collect the first day of the week of a Calendar.
package my_proj;
 
import java.util.Calendar;
 
public class my_first {
public static void main(String[] args) {
Calendar my_cal = Calendar.getInstance();// created calendar
System.out.println(my_cal.getFirstDayOfWeek()); // 1
my_cal.setFirstDayOfWeek(5);
System.out.println(my_cal.getFirstDayOfWeek()); // 5
}
}
We used setFirstDayOfWeek() to get the value to update the first day of week.

package my_proj;
 
import java.util.Calendar;
 
public class my_first {
public static void main(String[] args) {
Calendar my_cal = Calendar.getInstance();// created calendar
System.out.println(my_cal.getWeeksInWeekYear()); // 52
my_cal.getFirstDayOfWeek(5);
System.out.println(my_cal.getWeeksInWeekYear()); // 53
}
}
getLeastMaximum() getActualMaximum() Date & time tutorials


Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com



    Post your comments , suggestion , error , requirements etc here




    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer