///|
test {
// creates a UTC+8 fixed time zone.
let zone = @time.fixed_zone("Asia/Shanghai", 8 * 60 * 60)
// creates a ZonedDateTime from unix second and time zone.
let date_time = @time.unix(1714227729L, nanosecond=1000, zone~) catch {
_ => fail("expected unix time to parse")
}
inspect(
date_time.to_string(),
content="2024-04-27T22:22:09.000001+08:00[Asia/Shanghai]",
)
}type PlainDateimpl Show for PlainDateTimeimpl ToJson for PlainDateTimeimpl FromJson for PlainDateTimefn PlainDateTime::from_unix_second(second : Int64, nanosecond : Int, offset : ZoneOffset) -> PlainDateTime raisefn PlainDateTime::of(year : Int, month : Int, day : Int, hour? : Int, minute? : Int, second? : Int, nanosecond? : Int) -> PlainDateTime raisetype ZoneOffsetimpl Compare for ZoneOffsetimpl Eq for ZoneOffsetimpl Show for ZoneOffsetfn ZoneOffset::of(hours? : Int, minutes? : Int, seconds? : Int, abbrev? : String, dst? : Bool) -> ZoneOffset raisetype ZonedDateTimeimpl Eq for ZonedDateTimeimpl Show for ZonedDateTimeimpl ToJson for ZonedDateTimeimpl FromJson for ZonedDateTimefn ZonedDateTime::from_unix_second(second : Int64, nanosecond? : Int, zone? : Zone) -> ZonedDateTime raisefn ZonedDateTime::of(year : Int, month : Int, day : Int, hour? : Int, minute? : Int, second? : Int, nanosecond? : Int, zone? : Zone) -> ZonedDateTime raisefn date_time(year : Int, month : Int, day : Int, hour? : Int, minute? : Int, second? : Int, nanosecond? : Int, zone? : Zone) -> ZonedDateTime raiseA lightweight MoonBit ORM with typed queries, code generation, and multi-database engines
Dependencies