time
time(
date,style?):string
Defined in: format.ts:45
Writes a timestamp for message text. Discord shows it in the time zone and language of each reader.
Parameters
Section titled “Parameters”number | Date
The moment, as a Date or as milliseconds since 1970, such as Date.now().
style?
Section titled “style?”"short" | "short-time" | "long-time" | "short-date" | "long-date" | "long" | "relative" = 'short'
How Discord shows it: short (default, such as “5 November 2026 12:30”), long,
short-date, long-date, short-time, long-time or relative (such as “in 2 hours”).
Returns
Section titled “Returns”string
The timestamp markup, such as <t:1762338600:R>.
Example
Section titled “Example”c.reply(`The event starts ${time(start, 'relative')}`);