Custom Date and Time format
The custom date and time format is described by a string with value-substitution tags for dates and times:
Tags for substituting values for dates and times
Tag | What does | Sample |
G |
Era designator | AD |
y |
Year (4 digits) | 2012 |
yy |
Year (2 digits) | 12 |
yyyy |
Year (4 digits) | 2012 |
M |
Month number without leading zeros | 2 |
MM |
Month number with leading zeros | 02 |
MMM |
Three-letter reduction of the month | Feb |
MMMM |
Full name of the month | February |
w |
Week in a year without leading zeros | 7 |
ww |
Week in a year with leading zeros | 07 |
W |
Week in a month without leading zeros | 2 |
WW |
Week in a month with leading zeros | 02 |
D |
Day in year | 38 |
d |
Day in month without leading zeros | 7 |
dd |
Day in month with leading zeros | 07 |
F |
Day of week in month without leading zeros | 1 |
FF |
Day of week in month with leading zeros | 01 |
E |
Shortening the name of the day in week | Tue |
EEEE |
Day name in week | Tuesday |
a |
Am/pm marker | AM |
H |
Hour in day (0-23) without leading zeros | 6 |
HH |
Hour in day (0-23) with leading zeros | 06 |
h |
Hour in am/pm (1-12) without leading zeros | 6 |
hh |
Hour in am/pm (1-12) with leading zeros | 06 |
m |
Minute in hour without leading zeros | 2 |
mm |
Minute in hour with leading zeros | 02 |
s |
Second in minute without leading zeros | 1 |
ss |
Second in minute with leading zeros | 01 |
S |
Millisecond | 109 |
z |
Time zone | EET |
Z |
Time zone (RFC 822) | +0200 |
' |
escape character for text | ‘Date=’ |
'' |
quotation mark | ‘o”clock’ |
Examples of custom date and time format strings:
Format string | Result |
yyyy.MM.dd G 'at' HH:mm:ss z |
2012.02.07 AD at 16:55:57 EET |
EEE, MMM d, ''yy |
Tue, Feb 7, ’12 |
h:mm a |
4:55 PM |
hh 'o''clock' a, zzzz |
04 o’clock PM, Eastern European Time |
yyyyy.MMMMM.dd GGG hh:mm aaa |
02012.February.07 AD 04:55 PM |
EEE, d MMM yyyy HH:mm:ss Z |
Tue, 7 Feb 2012 16:55:57 +0200 |
yyMMddHHmmssZ |
120207165557+0200 |
Custom Display name format
The custom Display name format is described by a string with value-substitution tags:
Tags for substituting values
%f – The family name for the contact
%g – The given name for the contact
%m – The contact’s middle name
%p – The contact’s honorific prefix (“Mr”, “Ms”, “Dr” etc.)
%s – The contact’s honorific suffix (“Sr”, “Jr”, “III” etc.)
%g – The given name for the contact
%m – The contact’s middle name
%p – The contact’s honorific prefix (“Mr”, “Ms”, “Dr” etc.)
%s – The contact’s honorific suffix (“Sr”, “Jr”, “III” etc.)
5+