- 29 Jan 2023
- 2 Minutes to read
- Print
- DarkLight
Configuring Date Time Field
- Updated on 29 Jan 2023
- 2 Minutes to read
- Print
- DarkLight
Overview
The Date Time Field in Simple Forms allows designers to customize the format of the date and time input field. This allows for a more user-friendly and intuitive display of the date and time information and also helps to ensure that the date and time information entered by the end users is accurate and consistent.
To set a specific date time format, select the Date Time Field control and navigate to the Properties Panel > Control Type > EDIT.
Users can choose the following date and time formats,
- Date: Allows end users to input only the Date.
- Date Time: Allows end users to input both the Date and Time.
- Calendar: Allows end users to select a date on a calendar.
- Time: Allows end users to input only the Time.
Override Date Time Format
To customize the date time format, navigate to the Properties Panel > Setup Data > Override Date Time Format checkbox to True. The Date Format Textbox will now appear to accept the format tokens.
- Ensure to use a Date Time control type to use the combination of date and time format.
- If an invalid token is used, a validation error will be displayed.
Mo, Q, Qo, Do, DDDo, do, e, E, w, wo, ww, W, Wo, WW, N, NN, NNN, NNNN, NNNNN, gg, gggg, GG, GGGG ,A, a, k, kk, z or zz, Z, ZZ, X, x.
The following table describes various Date Time Field format tokens and the outputs that will display to the end user.
Date/Time Counter | Token | Output |
---|---|---|
Month | M | 1, 2, ... 11, 12 |
MM | 01, 02, ... 11, 12 | |
MMM | Jan, Feb, ... Nov, Dec | |
MMMM | January, February, ... November, December | |
Day of Month | D | 1, 2, ... 30, 31 |
DD | 01, 02, ... 20, 31 | |
Day of Year | DDD | 1, 2, ... 364, 365 |
DDDD | 001, 002, ... 364, 365 | |
Day of the Week | d | 0, 1, ... 5, 6 |
dd | Su, Mo, ... Fr, Sa | |
ddd | Sun, Mon, ... Fri, Sat | |
dddd | Sunday, Monday, ... Friday, Saturday | |
Year | Y | 1970, 1971, ... 9999, +10000, +10001 Note: This complies with the ISO 8601 standard for dates past the year 9999 |
YY | 70,71, ... 29, 30 | |
YYYY | 1970, 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) | |
Era Year | y | 1, 2, ... 2020 ... |
Hour | H | 0, 1, ... 22, 23 |
HH | 00, 01, ... 22, 23 | |
h | 1, 2, ... 11, 12 | |
hh | 01, 02, ... 11, 12 | |
Minute | m | 0, 1, ... 58, 59 |
mm | 00, 01, ... 58, 59 | |
Second | s | 0,1, ... 58, 59 |
ss | 00, 01, ... 58, 59 | |
Fractional Second | S | 0, 1, ... 8, 9 |
SS | 00, 01, ... 98, 99 | |
SSS | 000, 001, ... 998, 999 | |
SSSS...SSSSSSSSS | 000[0..], 001[0..], ... 998[0..], 999[0..] |
Example
In the following example, we have formatted the date-time to be MMMM/DD/YYYY HH:mm.
Once the users choose the date and time, this will get converted into the configured format as January/28/2023 15:25.