Custom Command
FunctionsDate Functions

$parseTime

Convert human-readable time strings into a duration. This function accepts a single duration or multiple durations combined into one expression, and can optionally return the result in a different unit.

Usage

$parseTime[time;unit?]

Arguments:

  • time: A time duration to convert. Supported units include:

    • ms — milliseconds
    • s — seconds
    • m — minutes
    • h — hours
    • d — days
    • w — weeks
    • M — months (30 days)
    • y — years (365 days)
  • unit (optional): The unit to return. Supported values are ms, s, m, h, d, w, M, y, or their full names (such as seconds, hours, and days). Defaults to ms.

Multiple durations can be combined by separating them with spaces. As a convenience, compact expressions without spaces are also supported.

Examples

Member
9/5/2026

!!exec $parseTime[1m]

Custom Command
APP
9/5/2026

60000

Member
9/5/2026

!!exec $parseTime[1h 30m]

Custom Command
APP
9/5/2026

5400000

Member
9/5/2026

!!exec $parseTime[1h30m]

Custom Command
APP
9/5/2026

5400000

Member
9/5/2026

!!exec $parseTime[1h30m;m]

Custom Command
APP
9/5/2026

90

Explanation:

  • $parseTime[1m] converts 1 minute into 60000 milliseconds.
  • $parseTime[1h 30m] converts 1 hour and 30 minutes into 5400000 milliseconds.
  • $parseTime[1h30m] is interpreted the same way as 1h 30m for convenience.
  • $parseTime[1h30m;m] returns the result in minutes instead of milliseconds.

On this page