Here you can find the source of getDayOfWeek(long date)
Parameter | Description |
---|---|
date | date |
public static int getDayOfWeek(long date)
//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)); } } }