The code below returns the wrong day of the week. Could anyone help?
// get the supported ids for GMT-04:00 (Eastern Standard Time)
// when daylight savings time is in effect
// Fours hours behind GMT, zulu, UTC
// SimpleTimeZone est = new SimpleTimeZone(-4 * 60 * 60 * 1000, "EST");
// create a GregorianCalendar with the Eastern Standard
// time zone and the current date and time
Calendar calendar = new GregorianCalendar();
Date dd = new Date(System.currentTimeMillis());
calendar.setTime(dd);
// Cat it all together
String myTime = new String(calendar.get(Calendar.HOUR_OF_DAY) + ":"
+ calendar.get(Calendar.MINUTE));
System.out.println("myTime is:" + myTime);
int dayNum = calendar.get(Calendar.DAY_OF_WEEK);
String day = null;
switch (dayNum) {
case Calendar.SUNDAY:
day = "SUNDAY";
case Calendar.MONDAY:
day = "Monday";
case Calendar.TUESDAY:
day = "Tuesday";
case Calendar.WEDNESDAY:
day = "Wednsday";
case Calendar.THURSDAY:
day = "Thursday";
case Calendar.FRIDAY:
day = "Friday";
case Calendar.SATURDAY:
day = "Saturday";
System.out.println("Day of the week is : " + day);