Java Week Day getDayOfWeek(long date)

Here you can find the source of getDayOfWeek(long date)

Description

Returns the day of the week.

License

Open Source License

Parameter

Parameter Description
date date

Return

day of week.

Declaration

public static int getDayOfWeek(long date) 

Method Source Code


//package com.java2s;
import java.util.Calendar;

public class Main {
    private static Calendar CALENDAR = Calendar.getInstance();

    /**//from   w w  w.  ja v a  2  s.co  m
     * Returns the day of the week.
     *
     * @param date date
     * @return day of week.
     */
    public static int getDayOfWeek(long date) {
        Calendar calendar = CALENDAR;
        synchronized (calendar) {
            calendar.setTimeInMillis(date);
            return (calendar.get(Calendar.DAY_OF_WEEK));
        }
    }
}

Related

  1. getDayOfWeek(Date dt)
  2. getDayOfWeek(Date start, int day)
  3. getDayOfWeek(int _year, int _month, int _day)
  4. getDayOfWeek(int year, int month, int day)
  5. getDayOfWeek(long date)
  6. GetDayOfWeek(long p)
  7. getDayOfWeek(String dat)
  8. getDayOfWeek(String date)
  9. getDayOfWeek(String year, String month, String day)