Formatting Dates
You can control how dates appear in your document — for example displaying them as 25.02.2023, 2023-02-25, or including time.
Eledo formats dates using the DATE() function with standard Java-style date patterns.
Using the DATE function
The DATE() function converts a date value into a formatted text output:
DATE(value, date_format)
value— the input datedate_format— the desired output format
Input Date Value
Date values can come from:
- input fields (recommended: use Date type)
TODAY()— current dateTO_DATE()— convert text into a date
Date Format
The format pattern defines how the date is displayed.
Example:
DATE(item.date, "dd MM yyyy")
DATE(TODAY(), "yyyy-MM-dd")
Common Examples
DATE(item.date, "dd.MM.yyyy") → 25.02.2023
DATE(item.date, "yyyy-MM-dd") → 2023-02-25
DATE(item.date, "dd MMMM yyyy") → 25 February 2023
DATE(item.date, "dd/MM/yyyy HH:mm") → 25/02/2023 13:30
Date Format Reference
Date format patterns use case-sensitive letters to represent parts of the date.
The number of letters also affects the output.
| Letter | Date or Time component | Examples |
|---|---|---|
| y | Year | 2019 (yyyy), 19 (yy) |
| M | Month in year | January (MMMM), Jan (MMM), 01 (MM) |
| w | Week in year | 23 (w) |
| W | Week in month | 2 (W) |
| D | Day in year | 156 (D) |
| d | Day in month | 02 (dd), 2 (d) |
| F | Day of week in month | 5 (F) |
| E | Day name in the week | Friday (EEEE), Fri (EEE) |
| u | Day number of week (1 = Monday) | 7 (u) |
| a | AM or PM marker | AM (a) |
| H | Hour in day (0–23) | 21 (H), 03 (HH) |
| h | Hour in day (1–12) | 11 (h), 04 (hh) |
| k | Hour in day (1–24) | 24 (k), 05 (kk) |
| K | Hour in day (0–11) | 0 (K), 01 (KK) |
| m | Minute in hour | 5 (m), 05 (mm) |
| s | Second | 7 (s), 07 (ss) |
| S | Milliseconds | 584 (SSS) |
| z | Timezone | PST, GMT-08:00 |
| Z | Timezone offset | -0800 |
| X | ISO timezone offset | -08, -08:00 |
Timezone and Locale
Date output depends on your template settings:
- Timezone — affects the actual time value
- Locale — affects language and formatting (e.g. month names)
To ensure correct output, configure both in your template settings.
Additional examples
DATE(TODAY(), "yyyy-MM-dd") → 2023-02-25
DATE(item.date, "E, dd MMM yyyy HH:mm:ss z") → Sat, 25 Feb 2023 13:30:00 CET
Related
- See Printing Text for combining dates with other values
- See Formatting Numbers for numeric formatting
Was this article helpful?
Yes
No