Java Day of Week getWeekDay(Date date)

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

Description

get Week Day

License

Open Source License

Declaration

private static String getWeekDay(Date date) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

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

public class Main {
    private static final String[] WEEK_DAYS = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday",
            "Saturday" };

    private static String getWeekDay(Date date) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(date);/*from  w  w  w  . j av  a2 s  .c o  m*/
        int idx = cal.get(Calendar.DAY_OF_WEEK) - 1;
        return WEEK_DAYS[idx];
    }
}

Related

  1. getWeekDate(String date)
  2. getWeekDateList(Date today, int index)
  3. getWeekday(Date d)
  4. getWeekDay(Date d)
  5. getWeekDay(Date date)
  6. getWeekDay(Date date)
  7. getWeekDay(Date date)
  8. getWeekDay(Date dt, int weekDay)
  9. getWeekDay(String strDate)