Configuring Date Time Field Format Tokens
  • 07 Feb 2022
  • 2 Minutes to read
  • Dark
    Light

Configuring Date Time Field Format Tokens

  • Dark
    Light

Overview

Unique to Simple Forms, the Date Time Field control may display date and/or time in a variety of formats matching formal tokens of programs such as MomentJS.

To customize the date time format, open a Date Time Field's Properties, navigate to the Setup Data section and set the Override Date Format checkbox to True. The Date Format Textbox will now appear to accept the format tokens.

A Validation error will show when attempting to use a token not appropriate in the control. Depending on the data type, only certain tokens are supported:

  • Date only accepts date tokens (M,Q,D,d,w,y,etc.)
  • Time only accepts time tokens (A,a,H,h,m,s,etc.)
  • Date Time accepts both


Available Format Tokens

The following table describes various Date Time Field formats and the outputs that will display to the end-user.

Date/Time CounterTokenOutput
MonthM1, 2, ... 11, 12
Mo1st, 2nd, ... 11th, 12th
MM01, 02, ... 11, 12
MMMJan, Feb, ... Nov, Dec
MMMMJanuary, February, ... November, December
QuarterQ1, 2, 3, 4
Qo1st, 2nd, 3rd, 4th
Day of MonthD1, 2, ... 30, 31
Do1st, 2nd, ... 30th, 31st
DD01, 02, ... 20, 31
Day of YearDDD1, 2, ... 364, 365
DDDo1st, 2nd, ... 364th, 365th
DDDD001, 002, ... 364, 365
Day of the Weekd0, 1, ... 5, 6
do0th, 1st, ... 5th, 6th
ddSu, Mo, ... Fr, Sa
dddSun, Mon, ... Fri, Sat
ddddSunday, Monday, ... Friday, Saturday
Day of the Week (Locale)e0, 1, ... 5, 6
Day of the Week (ISO)E1, 2, ... 6, 7
Week of the Yearw1, 2, ... 52, 53
wo1st, 2nd, ... 52nd, 53rd
ww01, 02, ... 52, 53
Weeks of the Year (ISO)W1, 2, ... 52, 53
Wo1st, 2nd, ... 52nd, 53rd
WW01, 02, ... 52, 53


Year
Y1970, 1971, ... 9999, +10000, +10001
Note: This complies with the ISO 8601 standard for dates past the year 9999
YY70,71, ... 29, 30
YYYY1970, 1971, ... 2029, 2030
YYYYYY-001970, -001971, ... +001907, +001971
Note: Expanded Years that cover the full time value range of approximately 273,790 years forward or backward from January 1st, 1970)
Week Yeargg70, 71, ... 29, 30
gggg1970, 1971, ... 2029, 2030
Week Year (ISO)GG70, 71, ... 29, 30
GGGG1970, 1971, ... 2029, 2030
AM/PMAAM, PM
aam, pm
HourH0, 1, ... 22, 23
HH00, 01, ... 22, 23
h1, 2, ... 11, 12
hh01, 02, ... 11, 12
k1, 2, ... 23, 24
kk01, 02, ... 23, 24
Minutem0, 1, ... 58, 59
mm00, 01, ... 58, 59
Seconds0,1, ... 58, 59
ss00, 01, ... 58, 59
Fractional SecondS0, 1, ... 8, 9
SS00, 01, ... 98, 99
SSS000, 001, ... 998, 999
SSSS...SSSSSSSSS000[0..], 001[0..], ... 998[0..], 999[0..]
Timezonez / zzEST, CST, ... MST, PST

Note: As of MomentJS 1.6.0, the z/zz format tokens have been deprecated from plain moment objects. However, they do work if using a specific time zone with the moment-timezone addon.

Z-07:00, -06:00, ... +06:00, +07:00
ZZ-0700, -0600, ... +0600, +0700
Unix TimestampX1360013296
Unix Millisecond Timestampx1360013296123

Was this article helpful?