Answers for "how to get current day of the week in java"

1

get day of week java

public static String getDayStringNew(LocalDate date, Locale locale) {
    DayOfWeek day = date.getDayOfWeek();
    return day.getDisplayName(TextStyle.FULL, locale);
}
Posted by: Guest on May-19-2021
-1

get current day java

Calendar calendar = Calendar.getInstance();
int day = calendar.get(Calendar.DAY_OF_WEEK); 

switch (day) {
    case Calendar.SUNDAY:
        // Current day is Sunday
        break;
    case Calendar.MONDAY:
        // Current day is Monday
        break;
    case Calendar.TUESDAY:
        // etc.
        break;
}
Posted by: Guest on March-29-2020

Code answers related to "how to get current day of the week in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language