Java Calendar get day of week name by locale for long style format

Description

Java Calendar get day of week name by locale for long style format

import java.util.Calendar;
import java.util.Locale;
import java.util.Map;

public class Main {
  public static void main(String args[]) {
    Calendar now = Calendar.getInstance();
    Locale locale = Locale.getDefault();

    Map<String, Integer> names = now.getDisplayNames(Calendar.DAY_OF_WEEK, Calendar.LONG, locale);
    //from ww w.jav  a 2 s.c o m
    System.out.println(names);
  }
}



PreviousNext

Related