How to format the result for your database
With the Date and Time function, the date and time chosen by the user can be inserted in the {{CALENDAR_CUSTOM_FORMAT}} variable in a customized format.
For example, if you want the date in the form “25-12-2020 at 22:15” you will have to enter the following format in the“Custom return format” field:
DD-MM-YYYY to HH:mm
where DD is the day, MM the month, YYYY the year, HH the hour and mm the minutes.
Year
To display the year (2020 in the following example), you have several options:
- YYYY will display 2020
- YY will display 20
Month
To display the month (September in the following example), you have several options:
- M will display 9
- MM will display 09
- MMM will display sep
- MMMM will display September
Day
To display the day (a Monday 8 in the following example), you have several options:
- D will display 8
- DD will display 08
- DDD will display one
- DDD will post on Monday
Hours
To display the hours (22h in the following example), you have several options:
- HH (in uppercase) will display 22
- hh (lowercase) will display 10
Minutes
To display the minutes (11 in the following example), you have several options:
- mm (lowercase) will display 11
Tip: If you wish to display the “h” in hours, add an “h” in square brackets: “[h]”. HH[h]mm will therefore display 22h11
Timestamp
- X (in uppercase) will display the timestamp in seconds
- x (lowercase) will display the timestamp in milliseconds
Other
Thanks to certain formats, it is also possible to receive a ready-made date:
- L will display 05/19/2020
- LL will display May 19, 2020
- LLL will display May 19, 2020 12:11 PM
- LLLL displayed Tuesday, May 19, 2020 12:11 AM