Date Time (ii)

Source: Internet
Author: User
Tags time zones

//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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.