Calculated Date
Inserts a formatted date calculated based on the current date.
Parameters
1️⃣ Date Offset (default: 0
)
The offset from the current date. You can use days (d
), months (m
), and
years (y
) with a positive (empty) or negative (-
) sign.
Examples:
Offset | Description |
---|---|
1d | adds one day |
-2m | subtracts two months |
2y | adds two years |
1d-2m1y | adds one day, subtracts 2 months, and adds 1 year |
0 or empty | will just use the current date |
The order of the units doesn't matter.
2️⃣ Date Format (default: dd.MM.yyyy
)
The format of the date. You can use standard date format patterns.
Examples:
Pattern | Description |
---|---|
yyyy-MM-dd | 2020-05-01 |
M/d/yyyy | 5/1/2020 |
E, d MMM yyyy | Mon, 2 Jun 2020 |
Where:
Token | Description |
---|---|
yy | two-digit year |
yyyy | four-digit year |
MM | two-digit month |
MMM | shorthand month |
MMMM | full month name |
dd | two-digit day |
E | shorthand week day |
EEEE | full week day name |
3️⃣ Language (default: English
)
The language of the date. This parameter will affect the month and week day names.
Syntax
{@calculated-date|-1m1d|dd.MM.yyyy|English@}
The snippet above will insert the following date when expanded: 02.06.2024, assuming the current date is 01.07.2024.
Use Cases
- Current date with a specific format
- Calculated date relative to the current date
- Name of the month or week day
- File name based on the current date
- Date for a document
- Calculated deadline date
- Next date for a recurring event
Example 1
You always send documents from the previous month on the first day of the new month. You can use the following snippet to reference the previous month name and the last day of the previous month:
I have attached the {@calculated-date|-1m|MMMM|English@} report, covering
the period ending on {@calculated-date|-1d|yyyy-MM-dd|English@}.
This example will insert the following text when expanded (assuming that today
is 2024-07-01
):
I have attached the June report, covering the period ending on 2024-06-30.
Example 2
Invoice number with the previous month:
INV/{@calculated-date|-1m|MM/yyyy|English@}
This example will insert the following text when expanded (assuming that today
is 2024-07-01
):
INV/06/2024