Java Day of Week getWeekNum(Date date)

Here you can find the source of getWeekNum(Date date)

Description

get Week Num

License

Apache License

Declaration

public static String getWeekNum(Date date) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Calendar;
import java.util.Date;

import java.util.Locale;

public class Main {
    public static String getWeekNum(Date date) {

        Calendar c = Calendar.getInstance(Locale.CHINA);
        c.setTime(date);/*from w  ww . j av a 2 s.  c  om*/
        String week = Integer.toString(c.get(Calendar.WEEK_OF_YEAR));

        return week;

    }
}

Related

  1. getWeekDays(String _date, int _amount)
  2. getWeekDaysBetween(Date fromDate, Date toDate, int dayOfWeek)
  3. getWeekEnd(Date date, int w)
  4. getWeekFirstDay(Date weekday)
  5. getWeekID(Date dateValue)
  6. getWeekNumber(Date date)
  7. getWeekNumber(Date date, Integer day)
  8. getWeekNumberFromDate(Date date)
  9. getWeekNumOfYear(Date date)