Here you can find the source of getDayofTheDate(Date d1)
Parameter | Description |
---|---|
d1 | the date in question |
public static String getDayofTheDate(Date d1)
//package com.java2s; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; public class Main { /**/*w ww . j av a2 s .c o m*/ * To Find the day of the week * @param d1 the date in question * @return the day in number depending startin from 1 as Sunday */ public static String getDayofTheDate(Date d1) { String day = null; DateFormat f = new SimpleDateFormat("EEE"); try { day = f.format(d1); } catch (Exception e) { e.printStackTrace(); } return day; } }