m3e/time

Types

Time is a time

pub opaque type Time

Values

pub const default: Time
pub fn from_string(input: String) -> Result(Time, String)

from_string creates a new Time, returning an Error if the supplied string is invalid

pub fn less_than(time1: Time, time2: Time) -> Bool

less_than returns true if the first time is less than the second time

pub fn new(
  hour: Int,
  minute: Int,
  second: Int,
) -> Result(Time, String)

new creates a new Time, returning an Error if the supplied values are invalid

pub fn to_hhmm(t: Time) -> String

to_hhmm converts a Time to a string in the format hh:mm (i.e.truncating the seconds)

pub fn to_string(t: Time) -> String

to_string converts a Time to a string in the format hh:mm:ss

Search Document