import java.util. *;
public class DateDemo {
public static void main (String args []) {
Date date = new Date ();
// b use, short for month
String str = String.format (Locale.US, "English month abbreviation:% tb", date);
System.out.println (str);
System.out.printf ("Local month abbreviation:% tb% n", date);
// The use of B, the full name of the month
str = String.format (Locale.US, "English month full name:% tB", date);
System.out.println (str);
System.out.printf ("The full name of the local month:% tB% n", date);
// a use, week abbreviation
str = String.format (Locale.US, "Abbreviation for English week:% ta", date);
System.out.println (str);
// A use, full name
System.out.printf ("short for local week:% tA% n", date);
// The use of C, the first two digits
System.out.printf ("First two digits of the year (less than two digits followed by 0):% tC% n", date);
// y is used, two digits after the year
System.out.printf ("The last two digits of the year (less than two digits followed by 0):% ty% n", date);
// The use of j, the number of days in a year
System.out.printf ("Days of the year (ie days of the year):% tj% n", date);
// m usage, month
System.out.printf ("Two-digit month (less than two digits followed by 0):% tm% n", date);
// d use, day (two digits, not enough to zero)
System.out.printf ("Two-digit day (less than two digits followed by 0):% td% n", date);
// e's use, day (one digit is not padded)
System.out.printf ("Day of the month (without zeros):% te", date);
}
}
English Month Abbreviation: May
Local month abbreviation: May
English Month Full Name: May
Local month full name: May
English abbreviation for week: Thu
Abbreviation for local week: Thursday
The first two digits of the year (less than two digits followed by 0): 20
Last two digits of the year (less than two digits followed by 0): 17
Days of the year (ie days of the year): 124
Two-digit month (less than two digits followed by 0): 05
Two-digit day (less than two digits followed by 0): 04
Day of the month (not preceded by 0): 4
Java Date Date, the number of days of the year, the abbreviation of the week, how many days of the month, how many months