Java Day of Week dayNumberOfWeek(Date date)

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

Description

Day Number

License

Apache License

Parameter

Parameter Description
date a parameter

Declaration

public static int dayNumberOfWeek(Date date) 

Method Source Code

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

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

public class Main {
    /**/*from w  ww  . j a  va2  s. co m*/
     * Day Number 
     * @param date
     * @return
     */
    public static int dayNumberOfWeek(Date date) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(date);
        return cal.get(Calendar.DAY_OF_WEEK);
    }

    /**
     * Day number of current week 
     * @return
     */
    public static int dayNumberOfWeek() {
        return dayNumberOfWeek(new Date());
    }
}

Related

  1. calculateBusinessDays(Date startDate, Date endDate, int firstWeekendDay, int secondWeekendDay)
  2. Day_Of_Week(String Date, int DayCase)
  3. dayForWeek(String pTime)
  4. dayForWeek(String pTime)
  5. dayForWeek(String weeks)
  6. DayOfTheWeek(Date dt)
  7. dayOfWeek(Date date)
  8. dayOfWeek(Date inDate, TimeZone timeZone)
  9. dayOfWeek(Date time)