Menubar Calendar – Custom Formatting

Help :

Below are a few sample formatting examples and their results. :

Note : If you wish to see seconds, please click on Menubar Icon of the application and select “Show seconds in Menubar” option instead.

Formattting

Result

HH:mm

01:36

dd.MM.yy

30.01.20

EEEE, MMM d, yyyy

Thursday, Jan 30, 2020

MM/dd/yyyy

01/30/2020

E, d MMM yyyy HH:mm

Thu, 30 Jan 2020 01:36

MMMM yyyy

January 2020

MM-dd-yyyy HH:mm

01-30-2020 01:36

MMM d, yyyy

Jan 30, 2020

MMM d, h:mm a

Jan 30, 1:36 AM

EEEE, MMM d, yyyy

Wednesday, Sep 12, 2018

EEEE h:mm a

Mon 10:24 AM

E h:mm

Mon 10:15

h:mm

11:35

Below examples demonstrate each component of the formatting that could be used to create any desired date time formatting :

Field

Sym.

No.

Example

Description

era

G

1..3

AD

Era – Replaced with the Era string for the current date. One to three letters for the abbreviated form, four letters for the long form, five for the narrow form.

4

Anno Domini

5

A

year

y

1..n

1996

Year. Normally the length specifies the padding, but for two letters it also specifies the maximum length. Example:

Y

1..n

1997

Year (in “Week of Year” based calendars). Normally the length specifies the padding, but for two letters it also specifies the maximum length. This year designation is used in ISO year-week calendar as defined by ISO 8601, but can be used in non-Gregorian based calendar systems where week date processing is desired. May not always be the same value as calendar year.

u

1..n

4601

Extended year. This is a single number designating the year of this calendar system, encompassing all supra-year fields. For example, for the Julian calendar system, year numbers are positive, with an era of BCE or CE. An extended year value for the Julian calendar system assigns positive values to CE years and negative values to BCE years, with 1 BCE being year 0.

U

1..3

甲子

Cyclic year name. Calendars such as the Chinese lunar calendar (and related calendars) and the Hindu calendars use 60-year cycles of year names. Use one through three letters for the abbreviated name, four for the full name, or five for the narrow name (currently the data only provides abbreviated names, which will be used for all requested name widths). If the calendar does not provide cyclic year name data, or if the year value to be formatted is out of the range of years for which cyclic name data is provided, then numeric formatting is used (behaves like ‘y’).

4

(currently also 甲子)

5

(currently also 甲子)

quarter

Q

1..2

02

Quarter – Use one or two for the numerical quarter, three for the abbreviation, or four for the full name.

3

Q2

4

2nd quarter

q

1..2

02

Stand-Alone Quarter – Use one or two for the numerical quarter, three for the abbreviation, or four for the full name.

3

Q2

4

2nd quarter

month

M

1..2

09

Month – Use one or two for the numerical month, three for the abbreviation, four for the full name, or five for the narrow name.

3

Sept

4

September

5

S

L

1..2

09

Stand-Alone Month – Use one or two for the numerical month, three for the abbreviation, or four for the full name, or 5 for the narrow name.

3

Sept

4

September

5

S

l

1

(nothing)

This pattern character is deprecated, and should be ignored in patterns. It was originally intended to be used in combination with M to indicate placement of the symbol for leap month in the Chinese calendar. Placement of that marker is now specified using locale-specific <monthPatterns> data, and formatting and parsing of that marker should be handled as part of supporting the regular M and L pattern characters.

week

w

1..2

27

Week of Year.

W

1

3

Week of Month

day

d

1..2

1

Date – Day of the month

D

1..3

345

Day of year

F

1

2

Day of Week in Month. The example is for the 2nd Wed in July

g

1..n

2451334

Modified Julian day. This is different from the conventional Julian day number in two regards. First, it demarcates days at local zone midnight, rather than noon GMT. Second, it is a local number; that is, it depends on the local time zone. It can be thought of as a single number that encompasses all the date-related fields.

week

day

E

1..3

Tues

Day of week – Use one through three letters for the short day, or four for the full name, five for the narrow name, or six for the short name.

4

Tuesday

5

T

6

Tu

e

1..2

2

Local day of week. Same as E except adds a numeric value that will depend on the local starting day of the week, using one or two letters. For this example, Monday is the first day of the week.

3

Tues

4

Tuesday

5

T

6

Tu

c

1

2

Stand-Alone local day of week – Use one letter for the local numeric value (same as ‘e’), three for the short day, four for the full name, five for the narrow name, or six for the short name.

3

Tues

4

Tuesday

5

T

6

Tu

period

a

1

AM

AM or PM

hour

h

1..2

11

Hour [1-12]. When used in skeleton data or in a skeleton passed in an API for flexible date pattern generation, it should match the 12-hour-cycle format preferred by the locale (h or K); it should not match a 24-hour-cycle format (H or k). Use hh for zero padding.

H

1..2

13

Hour [0-23]. When used in skeleton data or in a skeleton passed in an API for flexible date pattern generation, it should match the 24-hour-cycle format preferred by the locale (H or k); it should not match a 12-hour-cycle format (h or K). Use HH for zero padding.

K

1..2

0

Hour [0-11]. When used in a skeleton, only matches K or h, see above. Use KK for zero padding.

k

1..2

24

Hour [1-24]. When used in a skeleton, only matches k or H, see above. Use kk for zero padding.

j

1..2

n/a

This is a special-purpose symbol. It must not occur in pattern or skeleton data. Instead, it is reserved for use in skeletons passed to APIs doing flexible date pattern generation. In such a context, it requests the preferred hour format for the locale (h, H, K, or k), as determined by whether h, H, K, or k is used in the standard short time format for the locale. In the implementation of such an API, ‘j’ must be replaced by h, H, K, or k before beginning a match against availableFormats data. Note that use of ‘j’ in a skeleton passed to an API is the only way to have a skeleton request a locale’s preferred time cycle type (12-hour or 24-hour).

minute

m

1..2

59

Minute. Use one or two for zero padding.