Time.TimeOfDay

lib/Time/TimeOfDay.gob

A time on a wall clock, with no date and no time zone: "opens at 09:00". From 00:00 up to but not including 24:00, to the nanosecond.

Stored as nanoseconds since midnight. There is no arithmetic with a Duration: a wall-clock time has no timeline, and the time that passes between two readings depends on the day and the zone.

type TimeOfDay : Ord
fun new : fun(Int, Int, Int) -> Option TimeOfDay

The time with this hour, minute and second, if each is in range.

fun withNanosecond : fun(TimeOfDay, Int) -> Option TimeOfDay

t with its fraction of a second replaced, if n is under a second.

let midnight : TimeOfDay
fun fromNanosOfDay : fun(Int) -> Option TimeOfDay
fun nanosOfDay : fun(TimeOfDay) -> Int
fun sinceMidnight : fun(TimeOfDay) -> Duration

The time on the clock since midnight, and back, for the types that put a reading on a day.

fun afterMidnight : fun(Duration) -> Option TimeOfDay
fun hour : fun(TimeOfDay) -> Int
fun minute : fun(TimeOfDay) -> Int
fun second : fun(TimeOfDay) -> Int
fun nanosecond : fun(TimeOfDay) -> Int
fun parse : fun(String) -> Option TimeOfDay

HH:MM, HH:MM:SS or HH:MM:SS.fff with one to nine digits after a . or ,. A leap second, :60, is read as :59: a wall-clock time has no sixty-first second to hold it.

fun read : fun(Reader) -> Option TimeOfDay

A time at the reader's position, for the types whose text contains one.

instance Show TimeOfDay

ISO 8601: 09:30:00, with a fraction of a second only if there is one, and then only as many digits as it needs: 09:30:00.25.