Skip to content
Math Notes Documentation
Open Math Notes

Dates & time

Math Notes understands calendar dates, clock times and durations. Dates can be written in several styles, stored in variables, and combined with time units.

Writing dates#

A date can be written as 10 June, June 10, 2023, 2019-04-01 or 12/02/1988. A date with numbers only is read day first (12/02/1988 is 12 February; 02/13/2024 is not a date), so write 2019-04-01 when it must not be ambiguous. Yearless dates resolve to their nearest occurrence, and a date can be saved in a variable:

start = March 4, 2025
start + 2 weeks
18 March 2025

The unconditional date words today, now, yesterday, tomorrow, christmas and halloween are always available.

today + 3 weeks
three weeks from today
4 days from now
four days from now

Calendar arithmetic#

Add or subtract time units from a date, or phrase it with after/before.

10 June + 3 weeks
1 July
April 1, 2019 - 3 months 5 days
27 December 2018
3 weeks after March 14, 2019
4 April 2019

Intervals#

Subtracting one date from another gives the interval between them.

January 10 - February 5
3 weeks 5 days
days until Christmas
days until 25 December

through … in days, midpoint between … and … and days since/between are also understood. An explicit year keeps the whole interval, so 2019-01-10 - 2020-02-05 does not wrap.

Date parts#

Ask for a single part of a date with a phrase:

days in February 2020
29 days
day number on February 11, 2019
42
day of month on March 11, 2019
11
week number on March 9, 2024
10

Workdays & work hours#

Workdays are Monday to Friday, and a full work day is eight hours. Public holidays are not counted yet.

workdays in 3 weeks
15 workdays
10 March to 17 March in workdays
5 workdays
5 workdays after March 14, 2019
21 March 2019
work hours in June
176 work hours (8h days)
weekday on March 9, 2024
Saturday

Formatting a date#

Use as with a pattern to format a date.

March 12, 2023 as EEEE, MMM d, yyyy
Sunday, Mar 12, 2023

Clock times#

A clock time such as 9:45 am, 1:30 or 16:00 takes durations and measures intervals. Clock times show in 24-hour by default; Settings → Clock switches to 12-hour.

16:00 + 3 hours 12 minutes
a clock time 3 hours 12 minutes later
7:30am to 8:45pm
13 hours 15 minutes
now + 3 hours 15 minutes
a clock time 3¼ hours from now

Timespans#

Show a duration as a timespan of components, or split it into two units. A timespan is a real duration, so it can be added and multiplied, and converted to a single unit with to/in/as.

5.5 minutes as timespan
5 min 30 s
72 days as timespan
10 weeks 2 days
3h 5m 10s
3 hours 5 minutes 10 seconds
3h 5m 10s in seconds
11,110 seconds
12.5 minutes in minutes and seconds
12 min 30 s

Because a timespan is a real value, it can be referenced like any other:

5.5 minutes as timespan
line(1) + 1h
last line: 1 hour 5 minutes 30 seconds