Skip to main content
Date and time helpers format and manipulate date values.

formatDate

Formats a date according to a pattern.

Format Tokens

Examples

Output: 2024-12-15
Output: December 15, 2024
Output: Dec 15, 2024
Output: 12/15/2024
Output: 15 December 2024

formatTime

Formats the time portion of a date.
Examples:
Output: 14:30
Output: 2:30 PM

formatDateTime

Combines date and time formatting.
Examples:
Output: Dec 15, 2024 2:30 PM

now

Returns the current date/time formatted.
Examples:
Output: 2024-12-15
Output: December 15, 2024

addDays

Adds days to a date.
Examples:
Output: 2025-01-14
Output: 2024-12-08 Use case - Due dates:

daysBetween

Calculates the number of days between two dates.
Examples:
Output: 14

monthName

Returns the full name of the month.
Examples:
Output: December

dayName

Returns the name of the day of the week.
Examples:
Output: Sunday

Practical Examples

Invoice Header

Payment Terms

Event Details

Overdue Notice

Report Period