List of usage examples for java.util Calendar isWeekDateSupported
public boolean isWeekDateSupported()
From source file:Main.java
public static void main(String[] args) { Calendar now = Calendar.getInstance(); System.out.print(now.isWeekDateSupported()); }
From source file:Test.java
public static void main(String[] args) { Calendar calendar = Calendar.getInstance(); if (calendar.isWeekDateSupported()) { System.out.println("Number of weeks in this year: " + calendar.getWeeksInWeekYear()); System.out.println("Current week number: " + calendar.get(Calendar.WEEK_OF_YEAR)); }// w w w .jav a 2 s . c o m calendar.setWeekDate(2012, 16, 3); System.out.println( DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG).format(calendar.getTime())); }