Apps Part of Timeslice

Timeslice Duration & Time Range Parser

Turn 1h30, 90m, 1:30, 9-10:30 or 9am to 1pm into h:mm, decimal hours and ISO 8601.

Durations: 1h30, 1h 30m, 90m, 1:30, 1.5 (a bare number up to 10 is hours, larger whole numbers are minutes), PT1H30M. Ranges: 9-10:30, 9:00–17:30, 9am to 1pm, 14:00 + 45m.

Try an example: · ·

More about this tool

How it works

Reads durations and time ranges the way people type them — 1h30, 1 hour 30 minutes, 90m, 1:30, 1,5 h, PT1H30M, 9-10:30, 9am to 1pm, 22:00-02:00, 14:00 + 45m — one per line, and returns each as h:mm, decimal hours and an ISO 8601 duration, with the total and how every line was read.

  • Each line is tried as a time range first (start–end, “to”, “until”, “bis”, or start + duration), then as a duration, then as a single time of day. An end at or before the start means the range ends on the next day.
  • Durations: number + unit tokens (d, h, hr, hour, min, m, s, also German Std/Min) from large to small; a trailing bare number after hours means minutes (1h30); h:mm and h:mm:ss; ISO 8601 PnDTnHnMnS. A bare number up to 10 counts as hours, a larger whole number as minutes.
  • Times: 9, 930, 9:30, 9.30, 9h30, 21h, 9:30 pm, 12 am = 00:00, 12 pm = noon, noon and midnight; 24:00 is the end of the day. A meridiem on the end time also applies to the start when the start has none (9-11am).
  • Decimal hours are rounded to two places for display; totals use exact seconds. Optional rounding applies to each line before the total.

Sources

Part of Timeslice

  • Timeslice Time tracker & timesheets

    Track time on your own tasks, see where it went in charts and share a read-only report.

    Open Timeslice

How to use the Timeslice Duration & Time Range Parser

Turn durations and time ranges written in any common way — 1h30, 90m, 1:30, 1,5 h, 9-10:30, 9am to 1pm — into h:mm, decimal hours and ISO 8601, with an optional rounding step.

What it is for

People write time in a dozen ways: 1h30, 90m, 1:30, 1,5 h, 1 Std 30 Min, 9-10:30 or 9am to 1pm. Spreadsheets and invoicing tools want one format, usually decimal hours. This parser reads one line at a time, tells you how it understood each line, and adds them up as h:mm, decimal hours and an ISO 8601 duration such as PT1H30M.

It is the same reader the Timeslice app uses in its duration and time fields, so a value that works here works there.

Worked example

The first example has eight lines in mixed styles. The result: 8 of 8 lines understood; together they add up to 17:00 h (17.00 decimal hours). The table shows how each line was read:

  • 1h30, 90m and 1,5 h are durations of 1:30 (1.50, PT1H30M); 2:15 is 2:15 (2.25).
  • 9-10:30 is a time range from 09:00 to 10:30, and 9am to 1pm runs from 09:00 to 13:00, 4:00.
  • 22:00-02:00 ends after midnight, on the next day: 4:00.
  • 14:00 + 45m is a start plus a duration: 14:00 to 14:45.

A custom run with 9-11am, 1h45, 22:30-1:15, 1 Std 30 Min and lunch gives 4 of 5 lines understood and 8:00 h in total. The am in 9-11am also applies to the 9, and lunch gets the note Not a duration, time or time range plus examples of what works.

How to read the result

  • Read as says whether a line was a duration, a time range or a start + duration. Check it when a line could be read two ways.
  • Start and End appear for ranges, shown in 24-hour or 12-hour style as chosen under Show times as.
  • h:mm, Decimal and ISO 8601 are the same length in three formats. Decimal hours are rounded to two places for display; the total uses the exact minutes.
  • Lines understood counts the lines that went into the total. Lines that were not understood are listed, never guessed.

Tips and common mistakes

  • A plain whole number up to 10 counts as hours (8 = 8:00), a larger one as minutes (45 = 0:45); decimals are always hours. Write 0.75 or 45m if in doubt.
  • A comma works as a decimal separator: 1,5 is 1.5 hours.
  • 1:30 is hours and minutes, never minutes and seconds; write 1:30:15 for seconds.
  • Round each line to 6 minutes gives tenths of an hour, as many lawyers and consultants bill: 17m becomes 0:18 and 1h04 becomes 1:06, to the nearest step.
  • Ranges can be written with a hyphen, en dash, to, till or bis.

FAQ

What is ISO 8601 duration format?

A standard text form for durations, for example PT1H30M for 1 hour 30 minutes. Calendar files, APIs and many programs accept it.

Can a range cross midnight?

Yes. If the end is earlier than the start, the range runs into the next day, and the note says so.

Does it understand words like noon?

Yes, noon and midnight work as times, and German units such as Std and Min work for durations.

Guide last updated:

For scripts and AI agents

  • JSON API: POST https://timeslicedurationparser.usefulweb.app/api/v1/calculate (same calculation as this page)
  • Interface description: OpenAPI 3.1 · AI guide: llms.txt
  • MCP server (Streamable HTTP): https://timeslicedurationparser.usefulweb.app/mcp · tool name timeslice_duration_parser
Example request
curl -s -X POST https://timeslicedurationparser.usefulweb.app/api/v1/calculate \
  -H 'content-type: application/json' \
  -d '{"lines":"1h30\n90m\n2:15\n1,5 h\n9-10:30\n9am to 1pm\n22:00-02:00\n14:00 + 45m"}'
Feedback · ideas & bug reports welcome