rosetta/datetime

Types

Represents date and time data structure without timezone information. This format is lossy.

pub type DateTimeNaive {
  DateTimeNaive(
    year: Year,
    month: Month,
    day: Day,
    hour: Hour,
    minute: Minute,
    second: Second,
  )
}

Constructors

  • DateTimeNaive(
      year: Year,
      month: Month,
      day: Day,
      hour: Hour,
      minute: Minute,
      second: Second,
    )

Alias for Day

pub type Day =
  Int

Aliast for Hour

pub type Hour =
  Int

Alias for Minute

pub type Minute =
  Int

Alias for Month

pub type Month =
  Int

Represents naive date (without timezone data.)

pub type NaiveDate {
  NaiveDate(year: Year, month: Month, day: Day)
}

Constructors

  • NaiveDate(year: Year, month: Month, day: Day)

Alias for Second

pub type Second =
  Int

Alias type for Timestamp. Timestamp is always given in UTC.

pub type Timestamp =
  Int

Alias for year

pub type Year =
  Int

Functions

pub fn date() -> NaiveDate

Returns current date as NaiveDate. Naive Date is not corrected with timezone.

pub fn naivedate_to_tuple(d: NaiveDate) -> #(Int, Int, Int)

Utility function. Converts NaiveDate into tuple.

pub fn nilfunc() -> Nil
pub fn timestamp() -> Int

Returns current system timestamp as Timestamp

Search Document