Skip to main content

Calculated Time

Inserts a formatted time calculated based on the current time.

Parameters

1️⃣ Time Offset (default: 0)

The offset from the current time. You can use hours (h), minutes (m), and seconds (s) with a positive (empty) or negative (-) sign.

Examples:

OffsetDescription
1hadds one hour
-2msubtracts two minutes
20sadds twenty seconds
1h-15m10sadds one hour, subtracts 15 minutes, and adds 10 seconds
0 or emptywill just use the current time

The order of the units doesn't matter.

2️⃣ Time Format (default: HH:mm)

The format of the time. You can use standard time format patterns.

Examples:

PatternDescription
HH:mm16:24
hh:mm a04:24 PM
h:mm:ss4:24:03

Where:

TokenDescription
HHtwo-digit hours (24-hour format)
hhtwo-digit hours (12-hour format)
hhours without leading 0
mmtwo-digit minutes
mminutes without leading 0
sstwo-digit seconds
sseconds without leading 0
aAM/PM

Syntax

{@calculated-time|-1h-15m|HH:mm@}

The snippet above will insert the following time when expanded: 21:50, assuming the current time is 23:05.

Use Cases

  • Current time with a specific format
  • Calculated time relative to the current time
  • File name based on the current time
  • Calculated deadline based on the current time

Example 1

You often send a reminder less than 1 hour before the meeting. You could use the following snippet:

Friendly Reminder!
The meeting starts in about 1 hour.
Please join the call at {@calculated-time|1h|HH@}:00.

This example will insert the following text when expanded (assuming the current time is 16:10):

Friendly Reminder!
The meeting starts in about 1 hour.
Please join the call at 17:00.

Example 2

You often rename pictures using the following format: photo_yyyyMMdd_HHmmss.jpg.

You could use the following snippet to quickly generate the file name:

photo_{@calculated-date|0|yyyyMMdd|English@}_{@calculated-time|0|HHmmss@}.jpg

This example will insert the following text when expanded (assuming that today is 2024-07-01 and the current time is 16:30:10):

photo_20240701_163010.jpg