The OpenD Programming Language

TimeOfDay.fromISOString

Creates a TimeOfDay from a string with the format HHMMSS. Whitespace is stripped from the given string.

struct TimeOfDay
static @safe pure
fromISOString
(
S
)
(
scope const S isoString
)

Parameters

isoString S

A string formatted in the ISO format for times.

Throws

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

Examples

assert(TimeOfDay.fromISOString("000000") == TimeOfDay(0, 0, 0));
assert(TimeOfDay.fromISOString("123033") == TimeOfDay(12, 30, 33));
assert(TimeOfDay.fromISOString(" 123033 ") == TimeOfDay(12, 30, 33));

Meta