Formatting Date and Time in Articles
Articles supports a flexible date and time formatting system based on standard Delphi-style format tokens. These tokens allow you to control how dates and times appear inside expressions, calculated fields, and dynamic text blocks throughout your documents.
Core Date Tokens
The following tokens control how the date portion is displayed:
- d — Day without leading zero (7)
- dd — Day with leading zero (07)
- ddd — Abbreviated weekday name (Tue)
- dddd — Full weekday name (Tuesday)
- m — Month without leading zero (2)
- mm — Month with leading zero (02)
- mmm — Abbreviated month name (Feb)
- mmmm — Full month name (February)
- yy — Two‑digit year (26)
- yyyy — Four‑digit year (2026)
Core Time Tokens
These tokens control the time portion:
- h — Hour without leading zero (0–23)
- hh — Hour with leading zero
- n — Minute
- nn — Minute with leading zero
- s — Second
- ss — Second with leading zero
- AM/PM — Uppercase AM/PM indicator
- am/pm — Lowercase am/pm indicator
Common Date Formats
These examples show how tokens combine to produce common date styles:
- mm/dd/yyyy → 02/26/2026
- mmmm d, yyyy → February 26, 2026
- ddd, mmm d → Thu, Feb 26
- yyyy-mm-dd → 2026-02-26
Common Time Formats
- hh:nn:ss → 14:05:33
- h:nn AM/PM → 2:05 PM
Using Date and Time Formats in Expressions
Articles allows you to apply formatting directly inside expressions using the FormatDateTime function. The function accepts a format string and a date value.
FormatDateTime('mmmm d, yyyy', <Orders."OrderDate">)
This produces output such as:
February 26, 2026
Combining Text and Formatted Dates
You can embed formatted dates inside larger text blocks:
'Order placed on ' + FormatDateTime('mm/dd/yyyy', <Orders."OrderDate">)
Result:
Order placed on 02/26/2026
Formatting with Conditions
Expressions can include conditional logic to control how dates appear:
IIf(<Orders."ShippedDate"> <> 0,
FormatDateTime('mmmm d, yyyy', <Orders."ShippedDate">),
'Not yet shipped'
)
Best Practices
- Use four-digit years (yyyy) for clarity.
- Use month names (mmm or mmmm) when the audience is international.
- Use format (mm/dd/yyyy) when space is limited.
- Wrap field references in parentheses when passing them to functions.
These formatting tools allow Articles to present dates and times clearly and consistently across invoices, statements, letters, and all other document types.