This site describes solve-engine 2.44.0, the version npm installs.
Relative dates
Package:
DATETIME_PACKAGE. Registered bycreateEngine(); for a slimmer engine, register it explicitly (see choosing packages).
A relative date names a day by its relation to today rather than by its calendar number, the way you would say tomorrow or next friday out loud. Each resolves against the current date. The answers on this page are worked out for one fixed moment, noon on Wednesday 11 March 2026 in London, so that they can be checked; the notepad under each example works them out for your own today.
now // Wednesday, March 11, 2026, 12:00:00 PMtoday // Wednesday, March 11, 2026tomorrow // Thursday, March 12, 2026yesterday // Tuesday, March 10, 2026next friday // Friday, March 13, 2026last monday // Monday, March 9, 2026What each one means
Section titled “What each one means”A few of these read differently from how they are often said, so each is set out here, against the same fixed moment.
today is a day, not the current instant. today, tomorrow and
yesterday name a day, anchored at local midnight, so each shows as a date with
no time of day. now is the current instant, with its time of day. A count of
days from today is a whole number: at noon, days until 25 december is 289 days
rather than 288.50. An app can keep the time of day on these instead, as
counting from the start of the day sets
out.
now // Wednesday, March 11, 2026, 12:00:00 PMtoday // Wednesday, March 11, 2026days until 25 december // 289 days3 days from today // Saturday, March 14, 20263 days before today // Sunday, March 8, 2026next and last step over today. next friday is the first Friday after
today and last friday the most recent one before it, so either one said on a
Friday is a week away rather than today. On Wednesday 11 March, next friday is
the 13th and last friday the 6th, and next saturday is the 14th, the day
after that Friday.
next friday // Friday, March 13, 2026last friday // Friday, March 6, 2026next saturday // Saturday, March 14, 2026Days ago
Section titled “Days ago”A length of time followed by ago counts back from now. A span of a day or more
counts back from today, the way 3 days before today does, so it is a date. A
shorter span counts back from the clock, so it keeps the time of day. Any
length of time works, from minutes to years.
3 days ago // Sunday, March 8, 20262 hours ago // Wednesday, March 11, 2026, 10:00:00 AM1 year ago // Tuesday, March 11, 2025ago is read this way only straight after a length of time. Anywhere else it
is an ordinary word, so a note that says 3 days ago I paid is left as text,
and a variable called ago still works.
This week, next month, last year
Section titled “This week, next month, last year”next week, this month, last week and last year name a whole week, month
or year, and each stands for its first day: next month is the first of next
month, and next week is next Monday. A week runs Monday to Sunday unless the host starts
it on another day, or the engine’s locale names a region whose week does (see
working days).
next week // Monday, March 16, 2026this week // Monday, March 9, 2026last week // Monday, March 2, 2026next month // Wednesday, April 1, 2026next year // Friday, January 1, 2027last year // Wednesday, January 1, 2025start of and end of pick the first or last day of a week, month or year,
the current one or a named one. beginning of is start of. The answer is the
day itself, at the start of it, so end of month is the 31st rather than the
last minute of it.
start of month // Sunday, March 1, 2026end of month // Tuesday, March 31, 2026end of next month // Thursday, April 30, 2026end of week // Sunday, March 15, 2026start of year // Thursday, January 1, 2026end of last year // Wednesday, December 31, 2025Each is an ordinary date, so it moves by a length of time and counts down like any other:
end of month + 1 day // Wednesday, April 1, 2026next week + 2 days // Wednesday, March 18, 2026start and end are claimed only before of and a period, so they stay free
as names: start = 5 and end - start work as they always have.
A day of the week
Section titled “A day of the week”this friday is the coming Friday: later this week, or today when today is a
Friday. That is the difference from next friday, which always steps over
today. Like next friday, it is a date with no time of day.
this friday // Friday, March 13, 2026this wednesday // Wednesday, March 11, 2026next wednesday // Wednesday, March 18, 2026A day of the week on its own inside a sum, or after days until, reads as
this friday does:
friday + 1 week // Friday, March 20, 2026days until friday // 2 daysA day of the week alone on a line is not read as a date. Notes head a day with
its name (Friday, then the day’s lines under it), and that heading should stay
text, so a line that is only a weekday is refused with a message suggesting
this friday or next friday. A heading with a colon, Friday: 3 hours, is
unaffected: the part after the colon is the line.
Counting from the start of the day
Section titled “Counting from the start of the day”A note that plans by the day means a date, not a moment, when it says
tomorrow: today + 3 weeks is a deadline, and the minute the line was typed
would be noise on it. So the engine reads a relative day as a date, anchored at
local midnight. An app that wants the time of day kept can choose that reading
with one setting, date.relativeDays. It takes two values:
"midnight", the default: each relative day starts at midnight, so it is a date with no time of day, and a count of days from today is a whole number."now": each relative day is the current instant moved by whole days, with the time of day, as every version before 2.44.0 read them.
createEngine({ config: { date: { relativeDays: "now" } } });The same lines at the same moment, noon on Wednesday 11 March 2026, under each:
| line | "midnight" (the default) | "now" |
|---|---|---|
today | Wednesday, March 11, 2026 | Wednesday, March 11, 2026, 12:00:00 PM |
tomorrow | Thursday, March 12, 2026 | Thursday, March 12, 2026, 12:00:00 PM |
next friday | Friday, March 13, 2026 | Friday, March 13, 2026, 12:00:00 PM |
3 days ago | Sunday, March 8, 2026 | Sunday, March 8, 2026, 12:00:00 PM |
today + 3 weeks | Wednesday, April 1, 2026 | Wednesday, April 1, 2026, 12:00:00 PM |
days until 25 december | 289 days | 288.50 days |
tomorrow - today | 1 day | 24:00 |
now | Wednesday, March 11, 2026, 12:00:00 PM | Wednesday, March 11, 2026, 12:00:00 PM |
2 hours ago | Wednesday, March 11, 2026, 10:00:00 AM | Wednesday, March 11, 2026, 10:00:00 AM |
Under "midnight" the setting reaches today, tomorrow and yesterday,
next and last with a weekday, this friday and a bare weekday in a sum, a
span of a day or more followed by ago, and the count in days until and
days since (and in weeks, months or years). Two days subtract to a count of
days, as two written dates do, rather than to hours on a clock.
The boundary, and why: now is the current instant under both settings, and so
is a span shorter than a day (2 hours ago, hours until 5pm), because those
are questions about the clock. A time added to the start of the day is a time on
it, so today + 2 hours is 2:00 AM; write now + 2 hours for two hours from
now. next week, end of month and the other whole periods already name a day,
so they read the same under both.
The start of the day is the zone’s own. On a day whose midnight the zone skips (Santiago springs forward at 00:00, so 6 September 2026 begins at 01:00) the day still shows as a date, and a whole number of days from it lands on the start of the day reached.
The boundary
Section titled “The boundary”Some natural spellings are still not read, and a line that uses one is refused rather than guessed at. Each has a spelling that works:
| Not read | Write instead |
|---|---|
in 3 days | 3 days from today |
a week ago | 1 week ago |
the day after tomorrow | tomorrow + 1 day |
Monday next week | next week, which is its Monday |
tomorrow at noon | tomorrow and a clock time on separate lines |
next weekend | next saturday |
end of quarter | end of month on the quarter’s last month |
The week starts on Monday unless the host or the locale’s region says
otherwise. A date so far away that no calendar holds it,
past AD 275760 or before 271821 BC, is refused rather than shown:
99999999999 days ago is an error, not a date.