Skip to main content

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 date
  • date_format — the desired output format

Input Date Value

Date values can come from:

  • input fields (recommended: use Date type)
  • TODAY() — current date
  • TO_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.

LetterDate or Time componentExamples
yYear2019 (yyyy), 19 (yy)
MMonth in yearJanuary (MMMM), Jan (MMM), 01 (MM)
wWeek in year23 (w)
WWeek in month2 (W)
DDay in year156 (D)
dDay in month02 (dd), 2 (d)
FDay of week in month5 (F)
EDay name in the weekFriday (EEEE), Fri (EEE)
uDay number of week (1 = Monday)7 (u)
aAM or PM markerAM (a)
HHour in day (0–23)21 (H), 03 (HH)
hHour in day (1–12)11 (h), 04 (hh)
kHour in day (1–24)24 (k), 05 (kk)
KHour in day (0–11)0 (K), 01 (KK)
mMinute in hour5 (m), 05 (mm)
sSecond7 (s), 07 (ss)
SMilliseconds584 (SSS)
zTimezonePST, GMT-08:00
ZTimezone offset-0800
XISO 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


Was this article helpful?

Yes
No