Here you can find the source of getStrDayOfWeek(int _year, int _month, int _day)
public static String getStrDayOfWeek(int _year, int _month, int _day)
//package com.java2s; import java.util.Calendar; public class Main { public static String getStrDayOfWeek(int _year, int _month, int _day) { int dayofweek = getDayOfWeek(_year, _month, _day); String res;//from ww w.j a va 2s .co m switch (dayofweek) { case 1: res = "Sun"; break; case 2: res = "Mon"; break; case 3: res = "Tue"; break; case 4: res = "Wed"; break; case 5: res = "Thu"; break; case 6: res = "Fri"; break; case 7: res = "Sat"; break; default: res = null; } return res; } public static int getDayOfWeek(int _year, int _month, int _day) { int year, month, date; Calendar cal = Calendar.getInstance(); cal.set(_year, _month - 1, _day); return cal.get(Calendar.DAY_OF_WEEK); } }