Skip to content

Duration Calculator

Runs in your browser

How long between two moments, what a date becomes after adding time to it, and what PT1H30M means.

Both dates are read in this zone, so a daylight-saving change between them counts.

The "Now" buttons work once the page has finished loading.

Time between

1 month, 1 day, 8 hours and 30 minutes

Sat 31 Jan 2026, 09:00 to Sun 1 Mar 2026, 17:30

Dates in the range

Calendar days

29

Business days

20

Monday to Friday, no public holidays

Elapsed time

Days

29.35

Weeks

4.19

Hours

704.5

Minutes

42,270

Seconds

2,536,200

Milliseconds

2,536,200,000

As a duration

ISO 8601

P1M1DT8H30M

Java Duration

PT704H30M

Compact

1mo 1d 8h 30m

How this one works

The difference between two dates is given two ways, because both are useful and they disagree. The sentence at the top counts calendar units: years, months and days as a person would say them, which is how Java's Period and Python's relativedelta count. Elapsed time counts the hours that pass, which is what a deadline or a bill runs on.

Adding a duration follows the same split: months and days move the calendar (so one month after 31 January is 28 February, and a day later is the same time tomorrow even if the clocks changed overnight), while hours, minutes and seconds are added as exact elapsed time. Half a day is 12 hours; half a month has no calendar meaning, so it is counted as 15 days and the result says so.

Calendar and business days count dates, not hours: from 23:00 one evening to 01:00 the next morning is one calendar day. They count the start date but not the end one, the way "3 days from Monday" lands on Thursday; tick "Count the end date too" for a booking or a leave request, where both ends count. Public holidays are not taken out, because they differ by country and guessing them would be worse than leaving them to you.

Questions

Why do the calendar figure and the elapsed days disagree?

Because months are not a fixed length. From 31 January to 1 March is "1 month and 1 day" on the calendar, but 29 elapsed days in 2026. Neither is wrong. Use the calendar reading for how people talk about it, and elapsed time for arithmetic.

What duration formats are understood?

ISO 8601 (P1Y2M3DT4H5M6S, and P2W for weeks), Java's Duration.toString() including its negative component form (PT-6H-30M), and plain text such as "1d 2h 30m", "90 minutes" or "2 years 6 months".

Does daylight saving affect the result?

Yes, and it is handled. The dates are turned into instants in the zone you choose, so a range that crosses a clock change has 23 or 25 hours in that day. If a date you pick, or a date a calculation lands on, falls in an hour that is skipped or happens twice, the tool says so and says which moment it used.

Are leap years and leap seconds handled?

Leap years, yes: February 2028 has 29 days here. Leap seconds, no: Unix time ignores them, so every minute is 60 seconds, the same assumption your database and language make.

Keyboard shortcuts

Global

  • Show this shortcuts dialogShift?
  • Toggle light / dark themeCtrlShiftL
  • Close dialogsEsc

Formatter & Validator

  • Format JSONCtrlEnter
  • Minify JSONCtrlShiftM
  • Copy outputCtrlShiftC
  • Download output as .jsonCtrlShiftS
  • Clear input and outputCtrlShiftX

Tree Viewer

  • Focus the search box/
  • Expand all nodesCtrlShiftE
  • Collapse all nodesCtrlShiftR

Diff

  • Swap document A and BCtrlShiftS

Time & date tools

  • Use the current time (Epoch Converter)CtrlEnter
  • Copy the main resultCtrlShiftC
  • Clear the inputCtrlShiftX

PHP Unserialize & Serialize

  • Convert an input over 2 MBCtrlEnter
  • Copy outputCtrlShiftC
  • Download outputCtrlShiftS
  • Clear input and outputCtrlShiftX

Keys & IDs

  • Generate a new token or UUID batchCtrlEnter
  • Copy the resultCtrlShiftC

JSON tools

JSON FormatterPretty-print or minify
JSON ValidatorCheck strict JSON validity
JSON Tree ViewerBrowse JSON as a tree
JSON DiffCompare two documents
JSON Path FinderExplore JSONPath expressions
JSON to CSVFlatten JSON into rows
CSV to JSONTurn rows back into objects
PHP UnserializeSerialized PHP to JSON
PHP SerializeJSON to serialized PHP

JWT tools

JWT DecoderClaims, signature and expiry
JWT VerifierWith a secret, PEM key or JWKS
JWT Expiry Checkeriat, nbf and exp in local time
JWT GeneratorBuild a signed test token
Base64URL EncoderEncode or decode a segment

Time & date tools

Epoch ConverterTimestamps to real dates
Cron Expression ExplainerCron in plain English
Time Zone ConverterOne moment, many cities
Duration CalculatorDate maths and durations

Keys & IDs

Password GeneratorSecure random secrets
UUID Generatorv1, v4, v5 or v7 UUIDs

Code formatters

SQL FormatterBeautify or minify SQL
HTML FormatterBeautify or minify HTML
CSS FormatterBeautify or minify CSS
JavaScript FormatterBeautify or minify JS
PHP FormatterBeautify PHP code
Markdown to HTMLConvert with a live preview

AI tools

Token CounterTokens for every model
Prompt Secret ScrubberHide keys and personal data

Pages

JSON toolsFormat, validate, compare and convert JSON.
JWT toolsDecode, verify and generate JSON Web Tokens.
Time & date toolsConvert timestamps, read cron, compare zones.
Keys & IDsGenerate secure tokens, passwords and UUIDs.
Code formattersFormat SQL, HTML, CSS, JavaScript and PHP code.
AI toolsCount tokens and hide secrets before you prompt.
HomePopular tools and categories
All categoriesBrowse tools by category
AboutWhat ToolJar is and why
PrivacyWhat is and is not collected

Theme

Switch to light theme
Switch to dark theme