Java Day of Week dayOfWeek(Date time)

Here you can find the source of dayOfWeek(Date time)

Description

day Of Week

License

Apache License

Declaration

public static int dayOfWeek(Date time) 

Method Source Code

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

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

public class Main {
    public static int dayOfWeek(Date time) {
        Calendar c = Calendar.getInstance();
        c.setTime(time);//from   www. j  ava2 s .c  o m
        int dayForWeek = 0;
        if (c.get(Calendar.DAY_OF_WEEK) == 1) {
            dayForWeek = 7;
        } else {
            dayForWeek = c.get(Calendar.DAY_OF_WEEK) - 1;
        }
        return dayForWeek;
    }
}

Related

  1. dayForWeek(String weeks)
  2. dayNumberOfWeek(Date date)
  3. DayOfTheWeek(Date dt)
  4. dayOfWeek(Date date)
  5. dayOfWeek(Date inDate, TimeZone timeZone)
  6. dayOfWeek(int dayMark)
  7. dayOfWeek(int year, int month, int day)
  8. dayOfWeekFromInt(final int theDay)
  9. dayOfWeekFromInteger(String aDay, boolean longName)