Java Day of Week dayOfWeek(Date inDate, TimeZone timeZone)

Here you can find the source of dayOfWeek(Date inDate, TimeZone timeZone)

Description

Calculate the day number for the given date.

License

Open Source License

Parameter

Parameter Description
inDate The given date.

Return

The day number.

Declaration

public static int dayOfWeek(Date inDate, TimeZone timeZone) 

Method Source Code


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

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

import java.util.TimeZone;

public class Main {
    /**/*  ww w. ja v a2 s . c om*/
     * Calculate the day number for the given date.
     * 
     * @param inDate The given date.
     * @return The day number.
     */
    public static int dayOfWeek(Date inDate, TimeZone timeZone) {
        Calendar calendar = Calendar.getInstance(timeZone);
        calendar.setTime(inDate);

        return calendar.get(Calendar.DAY_OF_WEEK);
    }
}

Related

  1. dayForWeek(String pTime)
  2. dayForWeek(String weeks)
  3. dayNumberOfWeek(Date date)
  4. DayOfTheWeek(Date dt)
  5. dayOfWeek(Date date)
  6. dayOfWeek(Date time)
  7. dayOfWeek(int dayMark)
  8. dayOfWeek(int year, int month, int day)
  9. dayOfWeekFromInt(final int theDay)