birl/datetime

Types

pub type Date {
  Date(year: Int, month: Int, day: Int)
}

Constructors

  • Date(year: Int, month: Int, day: Int)
pub opaque type DateTime
pub type Time {
  Time(hour: Int, minute: Int, second: Int)
}

Constructors

  • Time(hour: Int, minute: Int, second: Int)

Functions

pub fn add(value: DateTime, duration: Duration) -> DateTime
pub fn compare(a: DateTime, b: DateTime) -> Order
pub fn difference(a: DateTime, b: DateTime) -> Duration
pub fn from_iso(value: String) -> Result(DateTime, Nil)
pub fn from_parts(date: Date, time: Time) -> DateTime
pub fn now() -> DateTime
pub fn subtract(value: DateTime, duration: Duration) -> DateTime
pub fn to_iso(value: DateTime) -> String
pub fn to_parts(value: DateTime) -> #(Date, Time)
Search Document