TimeOfDay.fromISOExtString

Creates a TimeOfDay from a string with the format HH:MM:SS. Whitespace is stripped from the given string.

struct TimeOfDay
static @safe pure
fromISOExtString
(
S
)
(
scope const S isoExtString
)

Parameters

isoExtString S

A string formatted in the ISO Extended format for times.

Throws

std.datetime.date.DateTimeException if the given string is not in the ISO Extended format or if the resulting TimeOfDay would not be valid.

Examples

assert(TimeOfDay.fromISOExtString("00:00:00") == TimeOfDay(0, 0, 0));
assert(TimeOfDay.fromISOExtString("12:30:33") == TimeOfDay(12, 30, 33));
assert(TimeOfDay.fromISOExtString(" 12:30:33 ") == TimeOfDay(12, 30, 33));

Meta