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:
Offset | Description |
---|---|
1h | adds one hour |
-2m | subtracts two minutes |
20s | adds twenty seconds |
1h-15m10s | adds one hour, subtracts 15 minutes, and adds 10 seconds |
0 or empty | will 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:
Pattern | Description |
---|---|
HH:mm | 16:24 |
hh:mm a | 04:24 PM |
h:mm:ss | 4:24:03 |
Where:
Token | Description |
---|---|
HH | two-digit hours (24-hour format) |
hh | two-digit hours (12-hour format) |
h | hours without leading 0 |
mm | two-digit minutes |
m | minutes without leading 0 |
ss | two-digit seconds |
s | seconds without leading 0 |
a | AM/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