Get week days symbols in Java

Description

The following code shows how to get week days symbols.

Example


//from  www  .ja v  a2 s  .  c  om
import java.text.DateFormatSymbols;
import java.util.Calendar;

public class Main {

  public static void main(String[] args) {
    String dayNames[] = new DateFormatSymbols().getWeekdays();
    Calendar date2 = Calendar.getInstance();
    System.out.println("Today is a " + dayNames[date2.get(Calendar.DAY_OF_WEEK)]);
  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    Date »




Date Get
Date Set
Date Format
Date Compare
Date Convert
Date Calculation
Date Parse
Timezone