Skip to content

Quick Overview: Supported Duration Formats

Christopher Wolf edited this page Mar 11, 2026 · 6 revisions

The application provides a flexible time parser that understands both technical and natural language inputs. You can use these formats wherever a time duration is required.

Standard Duration Format

This format is best for precise, structured input. It follows the pattern: [-][days.]HH:mm:ss[.milliseconds]

Component Format Range / Description
Negative sign - Optional. Defines that the value provided is negative.
Days d. Optional. Any number of digits followed by a dot.
Hours HH Required. 00 to 23.
Minutes mm Required. 00 to 59.
Seconds ss Required. 00 to 59.
Milliseconds .fff Optional. Up to 3 digits following a dot.

Examples:

  • 12:30:00 → 12 hours, 30 minutes
  • 1.05:00:00 → 1 day, 5 hours
  • 00:00:45.500 → 45.5 seconds
  • -00:00:05 → -5 seconds

Human-Readable Format

This format is ideal for quick CLI input. You can mix and match units using full names or shorthand and it's case-insensetive as well.

ℹ️ Please note that a negative value is defined by a minus sign (-) in the first position of the entire string to be parse.

Supported Units

Unit Keywords (Case-Insensitive)
Negative sign -
Days d, day, days
Hours h, hour, hours
Minutes m, min, minute, minutes
Seconds s, sec, second, seconds
Milliseconds ms, millisecond, milliseconds

Key Features

  • Decimal Support: You can use decimals for larger units (e.g., 1.5h for 1 hour and 30 minutes).
  • Flexible Spacing: 1h30m and 1 h 30 m are both valid.
  • Automatic Rounding: All inputs are rounded to the nearest millisecond.

Examples:

  • 1d 12h
  • 5m 30s
  • 1.5 hours
  • 100ms
  • 2days 4h 15m 30s
  • -1m
  • -1m 13s

Clone this wiki locally