kitazith/timestamp

Types

A type-safe RFC 3339 timestamp backed by gleam_time.

Learn more: API Reference - Documentation - Discord > ISO8601 Date/Time

pub opaque type Timestamp

Values

pub fn from_rfc3339(input: String) -> Result(Timestamp, Nil)

Parse an RFC 3339 string into a Timestamp.

pub fn from_unix_seconds(seconds: Int) -> Timestamp

Create a Timestamp from Unix seconds.

pub fn to_json(ts: Timestamp) -> json.Json

Serialize a Timestamp to JSON as an RFC 3339 string.

pub fn to_string(ts: Timestamp) -> String

Convert a Timestamp to an RFC 3339 string in UTC.

Search Document