parseDuration

Parse a string as a duration.

@safe
Duration
parseDuration
(
string timeSpec
)

Parameters

timeSpec string

string to parse

Return Value

Type: Duration

a Duration

Throws

TimeParseException if unable to parse the string.

Examples

auto d = parseDuration("1 hours 2 minutes");

Meta