Here you can find the source of getDayOfWeek()
public static String getDayOfWeek()
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getDayOfWeek() { String dow = ""; SimpleDateFormat sdf = new SimpleDateFormat("E"); String day = sdf.format(new Date()).toLowerCase(); if (day.equals("sun")) { dow = "1"; } else if (day.equals("mon")) { dow = "2"; } else if (day.equals("tue")) { dow = "3"; } else if (day.equals("wed")) { dow = "4"; } else if (day.equals("thu")) { dow = "5"; } else if (day.equals("fri")) { dow = "6"; } else if (day.equals("sat")) { dow = "7"; }/*from w w w. j a va 2 s . c om*/ return dow; } }