← Every block

Date Calculator

Add or subtract a length of time from a date, or measure how long there is between two. Takes a date, a Unix timestamp or an ISO string. Runs in your browser.

Try one
From
By

Give it a moment.

Need to chain this with something else? Open in bode β†’

About Time Math

The only two sums that make sense

Shift takes a moment and a length and gives you a moment: ninety days from a launch date, an hour before a meeting, a token's expiry pushed back a week.

Between takes two moments and gives you a length: how long a job ran, how far off a deadline is, how old something is.

There is no third mode, because there is no third sum. A moment plus a moment is not anything β€” next Tuesday plus next Friday is not a date. Keeping that impossible is most of the reason moments and lengths are different kinds of value here at all.

Which came first is the answer

The gap is signed. Measuring to a moment that has already passed gives a negative number, and the readable output says before rather than after.

An absolute value would have thrown that away, and it is usually the part you care about: "3 minutes" is not an answer to whether a token is still good, while "3 minutes before" and "3 minutes after" both are.

A moment or a length, never both

Moment carries the result of a shift. Length and Seconds carry the result of a measurement. Only one side is ever present β€” the other is absent, so anything wired to it waits rather than running on a value that means nothing in the current mode.

They are separate ports rather than one "result" because they are different kinds of thing, and each has a block that knows how to open it up. Wire Moment into Time for other formats, or Time Zones to see it elsewhere. Wire Length into Duration for every unit at once.

It counts seconds, not calendar squares

Adding a day adds 86,400 seconds. Nearly always that is the same as moving one square on a calendar β€” except on the two days a year a zone changes its clocks, when the wall time lands an hour out.

Months and years are the same story, one size up: they are counted as 30 and 365 days, because neither has a fixed length. Adding a month to 31 January has no single right answer, so this block does arithmetic it can defend and leaves the calendar question to two real dates and Between.

Common questions

What can I type into the date boxes?
A date like 2026-01-01, a full ISO 8601 timestamp, a Unix time in seconds or milliseconds, or an HTTP date out of a response header. There is a calendar button for picking one, and a Now button, since most date arithmetic starts from today. A bare date is read as midnight UTC.
Why is the difference negative?
Because the order you wrote them in is part of the answer. A negative gap means the second moment is before the first, which is the difference between "the token expires in 3 minutes" and "it expired 3 minutes ago". The readable output says "before" or "after" so the sign is never the only clue.
Can I add months or years?
You can type them, and they are counted as 30 and 365 days β€” the same convention the Duration block uses and says out loud. That is arithmetic on a length, not calendar arithmetic: adding one month to 31 January has no single correct answer, and this block does not pretend otherwise. For exact calendar work, measure between two real dates instead.
Does it handle time zones and daylight saving?
It works in absolute time, so adding 24 hours adds exactly 86,400 seconds. On a day when the clocks change, that is 23 or 25 hours of wall time in the affected zone. Wire the result into the Time Zones block to see what any of it reads as locally.
I wired a date into By and got nothing.
By takes a LENGTH, not a moment β€” 90d, 1h30m, PT1H30M. A date wired in there is the commonest mix-up, because both ports carry text and nothing stops the connection, so the card says so. If you typed it, there is a button to move it into Between, which is usually what was meant; if it arrived down a wire the card tells you where to plug it instead, because a block can change its own settings but cannot move your wires for you. The same applies in reverse: a length wired where a moment goes is flagged too. A bare number that is large enough to be a Unix timestamp is treated as a date rather than as a very long duration.
Is anything sent anywhere?
No. It is arithmetic on two numbers, done in your browser. Nothing is uploaded and nothing is stored.