Here you can find the source of getDayName()
public static String getDayName()
//package com.java2s; //License from project: LGPL import java.util.Calendar; public class Main { /**/*from w w w. j a v a 2 s . co m*/ * Get the full name of the current day * @return The full name of the current day */ public static String getDayName() { Calendar cal = Calendar.getInstance(); int day = cal.get(Calendar.DAY_OF_WEEK); String strDay; switch (day) { case Calendar.SUNDAY: strDay = "Sunday"; break; case Calendar.MONDAY: strDay = "Monday"; break; case Calendar.TUESDAY: strDay = "Tuesday"; break; case Calendar.WEDNESDAY: strDay = "Wednesday"; break; case Calendar.THURSDAY: strDay = "Thursday"; break; case Calendar.FRIDAY: strDay = "Friday"; break; case Calendar.SATURDAY: strDay = "Saturday"; break; default: strDay = "ERROR"; break; } return strDay; } }