package com.test4;
import java.util.Calendar;
import java.util.Date;
public class Test5 {
public static void main(String[] args) {
Calendar c = Calendar.getInstance();
c.setTime(new Date());
System.out.println(c.get(Calendar.WEEK_OF_YEAR));
}
}
// ********格式化 每年的周数**************
int week = LocalDate.of(2019, 12, 30).get(WeekFields.ISO.weekOfWeekBasedYear());
int year = LocalDate.of(2019, 12, 30).get(WeekFields.ISO.weekBasedYear());
String formatWeek = new DecimalFormat("00").format(week);
System.out.println(year + "-" + formatWeek);//2020-01
// ********格式化 每年的周数**************