#datetime
The #datetime
Data Helper can be used in templates to output date and time fields in a defined format.
Today's Date
Used on it's own, the helper will output the current date and time according to when the template's generated.
For example:
Helper | Output | Format |
| Today's date | 30 May 2018 |
| Today's date | May 30th |
| Today's date and time | 30th May 2018 at 3:15pm |
Custom Field Dates
The helper can also be used in conjunction with Data Markers of the Date or Date/Time type to configure the format of the output.
For example:
Helper | Output | Format |
| The matters completion date | 12 October 2021 |
| The matters completion date | October 12th |
| The matters completion date and time | 12th October 2021 at 12:00pm |
Possible Formats
Use the below coding to format your output:
Input | Output | Format |
| 4 digit year | 2014 |
| 2 digit year | 14 |
| Month number | 2 |
| Month number with leading zero to ensure 2 digits | 02 |
| 3 letter abbreviation of month name | Jan |
| Month name | January |
| Date of the month | 1 |
| Date of the month with leading zero to ensure 2 digits | 01 |
| Date of the month with ordinal | 1st |
| 3 letter abbreviation of the day name | Mon |
| Day name | Monday |
| Hour | 7 |
| Hour with leading zero to ensure 2 digits | 07 |
| Minute with leading zero to ensure 2 digits | 05 |
| AM or PM | AM |
| am or pm | am |
Make use of symbols and text within the helper to further configure the output:
Input | Format |
| 1/8/21 |
| 01-08-2021 |
| Sunday the 01st of August 2021 |
| 02:30PM |