Here you can find the source of dayOfWeek(Date inDate, TimeZone timeZone)
Parameter | Description |
---|---|
inDate | The given date. |
public static int dayOfWeek(Date inDate, TimeZone timeZone)
//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); } }