How to calculate time expressions like 1d 2h 3m

A time expression squeezes a whole calculation into one line: 1d 2h 3m + 4h 5s - 2030s. It looks like code, but it is just shorthand for the sums in the rest of these guides. This page explains how to read expressions, how to write your own, and how to evaluate them by hand.

By Johnson Ramzan · Updated October 21, 2026

Open the Time Calculator

Home / Guides / Time Expressions

Most time sums arrive as a jumble: a journey of 2 hours 30 minutes, a stop of 45 minutes, a final leg of 1 hour 15 minutes, minus a 10-minute shortcut. Writing that as a single line - 2h 30m + 45m + 1h 15m - 10m - is what a time expression is. Each number carries a letter that says what unit it is, and plus and minus signs join the blocks. Programmers, video editors and project planners write time this way constantly, because a whole chain of adding and subtracting fits in one glance.

The third mode of the time calculator on this site is built to read exactly these lines. Type the expression, and it returns the total broken down into days, hours, minutes and seconds. This guide explains the grammar of the shorthand, works a full example by hand so you can see there is no magic in it, and covers the edge cases - decimals, negative answers, missing spaces - that come up in practice.

The grammar: four letters and two signs

An expression is built from blocks. A block is one or more number-and-letter pairs: 1d, 2h, 3m, 45s. The letters are d for days, h for hours, m for minutes and s for seconds, and each number belongs to the letter immediately after it. Blocks are joined by + or -, and everything is evaluated left to right - there is no multiplication, no division and no brackets to worry about. Spaces are optional (2h30m works), commas are ignored, and capital letters work too (2H 30M).

ExpressionIn plain wordsTotal
2h 30m + 45mTwo and a half hours, plus 45 minutes3 hours 15 minutes
90m - 1h90 minutes take away 1 hour30 minutes
1.5h + 30mOne and a half hours, plus half an hour2 hours
3d - 5hThree days take away 5 hours2 days 19 hours
45s + 45sTwo lots of 45 seconds1 minute 30 seconds

Two habits make expressions easy to read. First, keep the units in size order inside a block - days, hours, minutes, seconds - even though the maths does not care; your eye will thank you. Second, remember that m always means minutes. There is no month unit in expressions, because a month is not a fixed length of time, a point we return to in time units explained.

A chrome twin-bell alarm clock against a wooden wall - How to calculate time expressions like 1d 2h 3m
One line, whole calculation: expressions shine when a total has many parts - a journey, a project, a week's worth of sessions.

Worked example: 1d 2h 3m + 4h 5s - 2030s

The by-hand method for any expression is the convert-everything trick from our adding guide, pushed all the way down to seconds. Convert each block to seconds, apply the signs, then convert the answer back up the ladder.

  1. Convert the first block. 1d 2h 3m = 86,400 + 7,200 + 180 = 93,780 seconds.
  2. Convert the second block. 4h 5s = 14,400 + 5 = 14,405 seconds. Running total: 93,780 + 14,405 = 108,185 seconds.
  3. Subtract the third block. 108,185 - 2,030 = 106,155 seconds.
  4. Convert back up. 106,155 seconds is 1 whole day (86,400) with 19,755 left over; 19,755 is 5 hours (18,000) with 1,755 left; 1,755 is 29 minutes (1,740) with 15 seconds left.
  5. Answer: 1 day 5 hours 29 minutes 15 seconds.

Converting to seconds is the bulletproof route, but for friendlier numbers you can stay in minutes: 2h 30m + 45m is 150 + 45 = 195 minutes, which is 3 hours 15 minutes. Choose the unit that keeps the numbers small enough to trust - minutes for most daily sums, seconds when seconds are actually in the expression. Either way the rule is identical: one common unit, ordinary addition and subtraction, then convert back.

Where expressions earn their keep

Expressions are overkill for adding two times, and indispensable for adding nine. Consider tallying a week of practice sessions recorded as 1h 20m, 45m, 2h, 1h 5m, 30m and 1h 50m. As an expression - 1h 20m + 45m + 2h + 1h 5m + 30m + 1h 50m - it converts to 480 + 45 + 120 + 65 + 30 + 110 = 850 minutes in a single pass, which is 14 hours 10 minutes. Video editors live in this format when they total a timeline of clips, and anyone summing a project from a list of task estimates is doing the same thing; our guide on how to total time for a project builds a full project total this way. Spreadsheet users often end up here too after exporting times as text - and for sums that stay inside the spreadsheet, how to add times in Excel covers the native approach. When you are ready to test yourself, the questions in time addition practice questions include several expressions to evaluate. One more place expressions hide in plain sight: countdowns and deadlines. "The report is due in 2d 4h" is an expression used as a duration from now, and planners who write estimates this way can add a whole column of them - 2d 4h + 1d 6h + 3h - and get a delivery total of 3 days 13 hours in one pass, without ever converting a single entry into a date first.

Frequently asked questions

What do the letters d, h, m and s mean in a time expression?

They are the units: d is days, h is hours, m is minutes and s is seconds. Each number belongs to the letter right after it, so 2h 30m means 2 hours and 30 minutes. Watch out for m: in time expressions it always means minutes, never months.

Can I use decimal numbers in a time expression?

Yes. Values like 1.5h are allowed and mean one and a half hours - 90 minutes. Decimals are handy when a figure arrives as a decimal already, such as 0.25h for a quarter of an hour (15 minutes). The total comes out the same as if you had converted the decimal to minutes first.

Does the order of the parts matter?

Inside one block, no: 30m 2h and 2h 30m are the same length of time, because the parts are simply added. Between blocks, work left to right through the plus and minus signs. There is no multiplication or division in a time expression, so there are no priority rules to remember.

What happens if the answer goes negative?

Then the expression describes a length of time running backwards, shown with a minus sign - for example, 30m - 1h equals -30 minutes. That is a legitimate result when you are comparing two durations, and it usually means the thing being subtracted was bigger than the thing it was subtracted from. Check that you wrote the expression the way you meant it.

Can I write the units out as words, like 2 hours 30 minutes?

In the calculator's expression mode, no - it reads the single letters d, h, m and s, so type 2h 30m. When working by hand it makes no difference, because the method is identical: convert every part to the same unit, then add or subtract. Writing the letters is just faster and leaves less room for slips.

About the author
Johnson Ramzan builds and maintains every calculator on Time Calculator Tools himself, and he tests each one against worked examples he has done by hand before it is allowed near a reader. His guides follow US Department of Labor guidance on hours worked, overtime and rounding, and he writes them the way he would want a payslip explained to him: plain English, real numbers, and no step skipped. When a reader writes in with a shift pattern the tools handle badly, fixing it goes to the top of his list.
Last updated: October 21, 2026

Related guides

How to Add Hours and Minutes

The column method underneath every expression: carrying at 60, and the convert-to-minutes check.

Read the guide

How to Total Time for a Project

Expressions at work: turning a list of task estimates into one honest project total.

Read the guide

Time Addition Practice Questions

Test the skill: graded sums and expressions with full worked answers to check against.

Read the guide

How to Add Times in Excel and Google Sheets

The spreadsheet route to the same totals, including the [h]:mm format that stops sums wrapping at 24 hours.

Read the guide