When a date/time field is defined on a template, you have the option to set a value format pattern for the field. You can either select from the list of commonly used patterns or enter custom patterns.
Date Formatting:
M |
Displays the month as a number without a leading zero. |
MM |
Displays the month as a number with a leading zero when appropriate. |
MMM |
Displays the month as an abbreviation (Jan to Dec). |
MMMM |
Displays the month as a full name (January to December). |
MMMMM |
Displays the month as a single letter (J to D). |
d |
Displays the day as a number without a leading zero. |
dd |
Displays the day as a number with a leading zero when appropriate. |
EEE |
Displays the day as an abbreviation (Sun to Sat). |
EEEE |
Displays the day as a full name (Sunday to Saturday). |
yy |
Displays the year as a two-digit number. |
yyyy |
Displays the year as a four-digit number. |
Time Formatting:
h |
Displays the hour as a number without a leading zero based on a 12 hour clock. |
hh |
Displays the hour as a number with a leading zero when appropriate based on a 12 hour clock. |
H |
Displays the hour as a number without a leading zero based on a 24 hour clock. |
HH |
Displays the hour as a number with a leading zero when appropriate based on a 24 hour clock. |
m |
Displays the minute as a number without a leading zero. |
mm |
Displays the minute as a number with a leading zero when appropriate. |
s |
Displays the second as a number without a leading zero. |
ss |
Displays the second as a number with a leading zero when appropriate. |
SSS |
Displays fractions of a second. |
a, aa |
Displays the hour using a 12-hour clock with either the a/p or am/pm indicator. |
ZZZ |
Displays the offset from UTC time |
Examples:
To display |
As |
Use this code |
2/15/15 |
01/15/2015 |
MM/dd/yyyy |
02/15/15 |
15/2/15 |
d/m/yy |
02/15/15 |
15 Feb 2015 |
dd MMM yyyy |
02/15/15 |
Sunday, February 15, 2015 |
EEEE, MMMM dd, yyyy |
1:15 PM |
1:15 PM |
h:mm aa |
1:15 PM |
13:15 |
H:mm |
1:15 PM |
01:15 p |
hh:mm a |
Comments