birl/time
Types
pub type Month {
January
February
March
April
May
June
July
August
September
October
November
December
}
Constructors
-
January -
February -
March -
April -
May -
June -
July -
August -
September -
October -
November -
December
Functions
pub fn change_offset(value: Time, new_offset: String) -> Result(
Time,
Nil,
)
use this tp change the offset of a given time value.
Some examples of acceptable offsets:
"+330", "03:30", "-8:00","-7", "-0400", "03"
pub fn difference(a: Time, b: Time) -> Duration
pub fn from_iso8601(value: String) -> Result(Time, Nil)
pub fn from_parts(date: #(Int, Int, Int), time: #(
Int,
Int,
Int,
Int,
), offset: String) -> Result(Time, Nil)
pub fn from_unix(value: Int) -> Time
unix timestamps are the number of seconds that have elapsed since 00:00:00 UTC on January 1st, 1970
pub fn now_with_offset(offset: String) -> Result(Time, Nil)
use this to get the current time with a given offset.
Some examples of acceptable offsets:
"+330", "03:30", "-8:00","-7", "-0400", "03"
pub fn short_string_month(value: Time) -> String
pub fn short_string_weekday(value: Time) -> String
pub fn string_month(value: Time) -> String
pub fn string_weekday(value: Time) -> String
pub fn to_iso8601(value: Time) -> String
pub fn to_unix(value: Time) -> Int
unix timestamps are the number of seconds that have elapsed since 00:00:00 UTC on January 1st, 1970