//Calendar.class//If you are setting the month or week as a direct note of ±1, there is no problem with SimpleDateFormat. /* * #DAY_OF_WEEK * public final static int SUNDAY = 1; * Public final static int MONDAY = 2; * Public final static int Tuesday = 3; * Public final static int Wednesday = 4; * Public final static int Thursday = 5; * Public final static int FRIDAY = 6; * Public final static int SATURDAY = 7; * * #MONTH public * Final static int January = 0; * Public final static int February = 1; * Public final static int March = 2; * Public final static int APRIL = 3; * Public final static int may = 4; * Public final static int JUNE = 5; * Public final static int July = 6; * Public final static int August = 7; * Public final static int September = 8; * Public final static int October = 9; * Public final static int November = 10; * Public final static int December = 11; * Public final static int undecimber = 12; */
Map<string, integer> java.util.Calendar.getDisplayNames (int field, int style, locale locale)
field can be displayed with: months, days of the week
Style possible styles: abbreviation, full spell, all
Localse all possible time zones
Public Static void Main (string[] args) { = calendar.getinstance (); System.out.println (C.getdisplaynames (Calendar.day_of_week, Calendar.long, locale.uk)); System.out.println (C.getdisplaynames (Calendar.day_of_week, Calendar.short, locale.uk)); System.out.println (C.getdisplaynames (Calendar.day_of_week, Calendar.all_styles, locale.uk)); System.out.println (C.getdisplayname (Calendar.day_of_week, Calendar.long, locale.uk)); System.out.println (C.getdisplaynames (Calendar.month, Calendar.long, locale.uk)); System.out.println (C.getdisplayname (Calendar.month, Calendar.long, locale.uk)); }
Results:
{saturday=7, thursday=5, monday=2, tuesday=3, wednesday=4, friday=6, sunday=1}{thu=5, wed=4, sun=1, sat=7, fri=6, tue=3, mon=2}{thu=5, thursday=5, saturday=7, monday=2, wed=4, sun=1, tuesday=3, sat=7, wednesday=4, fri=6, tue=3, mon=2, friday=6, sunday=1}wednesday{october=9, january=0, april=3, february=1, august=7, june=5, november=Ten, july=6, may=4, december= One, march=2, september=8}june
Date Time (ii)