Java Week Day GetWeekDay()

Here you can find the source of GetWeekDay()

Description

Get Week Day

License

Apache License

Declaration

public static String GetWeekDay() 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Calendar;

public class Main {
    public static String GetWeekDay() {
        Calendar c = Calendar.getInstance();
        int dayOfWeek = c.get(Calendar.DAY_OF_WEEK);
        switch (dayOfWeek) {
        case 2:/*from w ww  .j  av  a2s  .  co  m*/
            return "monday";
        case 3:
            return "tuesday";
        case 4:
            return "wednesday";
        case 5:
            return "thursday";
        case 6:
            return "friday";
        case 7:
            return "saturday";
        case 1:
            return "sunday";
        }
        return "all";
    }
}

Related

  1. getSundayOfWeek()
  2. getThisWeekMonday()
  3. getTodayOfWeek()
  4. getWeek(Date today, int index, String format)
  5. getWeekBeginDay(String date)
  6. getWeekDay()
  7. getWeekDay()
  8. getWeekday(Date date)
  9. getWeekDay(Date date)