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 weeksThe unconditional date words today, now, yesterday, tomorrow, christmas and halloween are always available.
today + 3 weeks4 days from nowCalendar arithmetic#
Add or subtract time units from a date, or phrase it with after/before.
10 June + 3 weeksApril 1, 2019 - 3 months 5 days3 weeks after March 14, 2019Intervals#
Subtracting one date from another gives the interval between them.
January 10 - February 5days until Christmasthrough … 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 2020day number on February 11, 2019day of month on March 11, 2019week number on March 9, 2024Workdays & work hours#
Workdays are Monday to Friday, and a full work day is eight hours. Public holidays are not counted yet.
workdays in 3 weeks10 March to 17 March in workdays5 workdays after March 14, 2019work hours in Juneweekday on March 9, 2024Formatting a date#
Use as with a pattern to format a date.
March 12, 2023 as EEEE, MMM d, yyyyClock 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 minutes7:30am to 8:45pmnow + 3 hours 15 minutesTimespans#
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 timespan72 days as timespan3h 5m 10s3h 5m 10s in seconds12.5 minutes in minutes and secondsBecause a timespan is a real value, it can be referenced like any other:
5.5 minutes as timespan
line(1) + 1h