List of usage examples for java.util Calendar getWeeksInWeekYear
public int getWeeksInWeekYear()
From source file:Main.java
public static void main(String[] args) { Calendar now = Calendar.getInstance(); System.out.print(now.getWeeksInWeekYear()); }
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.j a v a2 s. c om*/ calendar.setWeekDate(2012, 16, 3); System.out.println( DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG).format(calendar.getTime())); }