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)
pub type Unit {
  MilliSecond
  Second
  Minute
  Hour
  Day
  Week
  Month
  Year
}

Constructors

  • MilliSecond
  • Second
  • Minute
  • Hour
  • Day
  • Week
  • Month
  • Year

Functions

pub fn add(value: DateTime, amount: Int, unit: Unit) -> DateTime
pub fn compare(a: DateTime, b: DateTime) -> Order
pub fn from_iso(value: String) -> Result(DateTime, Nil)
pub fn from_parts(date: Date, time: Time) -> DateTime
pub fn new() -> DateTime
pub fn subtract(value: DateTime, amount: Int, unit: Unit) -> DateTime
pub fn to_iso(value: DateTime) -> String
pub fn to_parts(value: DateTime) -> #(Date, Time)
Search Document