Expand description
Timestamps with the ability to be formatted in clients based on the client’s local timezone and locale.
Included is the TimestampStyle denoting how to format a timestamp and
the Timestamp itself, containing an optional style and a Unix timestamp.
§Examples
Format a Timestamp into a valid Discord Markdown markdown via its
implementation of Mention:
use twilight_mention::{Mention, timestamp::Timestamp};
let timestamp = Timestamp::new(1624047064, None);
println!("This action was performed at {}", timestamp.mention());TimestampStyle implements Display, which allows you to easily print
the display modifier of a style:
use twilight_mention::timestamp::TimestampStyle;
println!("The modifier is '{}'", TimestampStyle::RelativeTime);Structs§
- Timestamp
- Timestamp representing a time to be formatted based on a client’s current local timezone and locale.
- Timestamp
Style Conversion Error - Converting a
TimestampStylefrom a string slice failed.
Enums§
- Timestamp
Style - Style modifier denoting how to display a timestamp.
- Timestamp
Style Conversion Error Type - Type of
TimestampStyleConversionErrorthat occurred.