取得日期是某年的第几周

来源:互联网 发布:nba2009年总决赛数据 编辑:程序博客网 时间:2024/04/30 12:02
根据日期入得日期是某年的第几周。
  [java]
  //取得日期是某年的第几周
  
public static int getWeekOfYear(Date date){  Calendar cal = Calendar.getInstance();  cal.setTime(date);  int week_of_year = cal.get(Calendar.WEEK_OF_YEAR);  return week_of_year;  }

0 0