Skip to main content

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:

OffsetDescription
1dadds one day
-2msubtracts two months
2yadds two years
1d-2m1yadds one day, subtracts 2 months, and adds 1 year
0 or emptywill 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:

PatternDescription
yyyy-MM-dd2020-05-01
M/d/yyyy5/1/2020
E, d MMM yyyyMon, 2 Jun 2020

Where:

TokenDescription
yytwo-digit year
yyyyfour-digit year
MMtwo-digit month
MMMshorthand month
MMMMfull month name
ddtwo-digit day
Eshorthand week day
EEEEfull 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