You could potentially lay the time region toward style

You could potentially lay the time region toward style

If you’d like more control across the structure or parsing, throw the DateFormat you earn on factory approaches to a beneficial SimpleDateFormat . That it works well with more nations.

SimpleDateFormat

SimpleDateFormat was a tangible group utilized for formatting and you can parsing schedules for the a vocabulary-independent styles. It allows having formatting, parsing, and you will normalization. They platforms otherwise parses a night out together otherwise go out, the practical milliseconds because the GMT, The month of january. step 1, 1970.

SimpleDateFormat ‘s the only oriented-in the implementation of DateFormat . It offers a beneficial automated interface used in order to make formatted schedules and you can moments inside numerous types of formats. Brand new forms become all the popular of these.

Carry out a night out together-day formatter with the following strategies rather than constructing a situation off SimpleDateFormat . In this way, the program was going to score the ideal formatting trend out-of new location.

Date/Day Format Syntax

A date pattern try a set out-of letters, where specific strings of letters try replaced with time and date study out of a diary when formatting or accustomed make study for a diary when parsing.

The fresh Go out Profession Icon Dining table less than gets the emails utilized in activities to show the appropriate platforms to own a given location, particularly yyyy into the season. Emails ple, in the event that y is employed into seasons, “yy” might produce “99”, whereas “yyyy” produces “1999”. For some numerical fields, what number of characters determine industry depth. Such as, in the event the h is the hours, “h” you’ll generate “5”, but “hh” supplies “05”. For most letters, GГ¶rГјntГјle the number specifies if or not an abbreviated or full form should be utilized, but could keeps other options, since the here.

Several unmarried estimates means an exact unmarried quote, both inside or exterior single prices. Text message contained in this unmarried estimates isn’t translated at all (except for two adjoining unmarried prices). If not every ASCII page off a towards z and you can An inside Z is reserved as syntax letters, and require estimating if they’re so you can portray exact emails. Concurrently, particular ASCII punctuation letters may become variable down the road (such ‘:’ getting interpreted as date separator and you may ‘/’ since a romantic date separator, and you may changed by respective area-delicate letters in display screen).

“Stand-alone” opinions make reference to those people made to get up on their own individually, unlike becoming together with other formatted beliefs. “second quarter” would use the latest wider remain-alone structure “qqqq” , whereas “second one-fourth 2007” could use the standard format “QQQQ yyyy” . To find out more throughout the style and you may stay-alone forms, pick CLDR Calendar Issues.

Brand new trend characters found in the new Date Profession Symbol Dining table is actually discussed because of the CLDR; to learn more discover CLDR Big date Community Icon Desk.

Date Job Symbol Desk

Note: People letters in the development that aren’t on the selections off [‘a’..’z’] and you may [‘A’..’Z’] could well be treated since the cited text. For example, characters like ‘:’ , ‘.’ , ‘ ‘ , ‘#’ and you will ” will look in the resulting big date text even they are certainly not sealed inside single prices. Brand new unmarried quotation can be used in order to ‘escape’ letters. A few unmarried estimates consecutively, whether or not inside or additional a cited series, depict good ‘real’ unmarried quote.

Big date Zone Monitor Labels

ICU helps day zone display names laid out of the LDML (Unicode Location Data Markup Code ) specs. While the ICU 3.8, a lot of surrounding go out area labels are no longer of the individual time zones. Rather, a set of local big date zone names is on the good metazone and something or more personal date areas try mapped to help you an equivalent metazone. Such as for instance, metazone “America_Pacific” possesses its own display screen term studies eg “PST” “PDT” “PT” “Pacific Practical Time” “Pacific Sunlight Date” “Pacific Big date” and these names are mutual from the numerous private big date areas “America/Los_Angeles”, “America/Vancouver”, “America/Tijuana” etc. The brand new mapping regarding private time region to help you metazone is not good simple step 1-to-step 1 mapping, nonetheless it transform every now and then. Like, day area “America/Indiana/Tell_City” spends name investigation from metazone “America_Eastern” up until erica_Central” adopting the date. Therefore the display identity useful “America/Indiana/Tell_City” till the date (age.grams. “Eastern Date”) differs from the one following go out (e.g. “Central Date).

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *