Skip to content

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.

number | Date

The moment, as a Date or as milliseconds since 1970, such as Date.now().

"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”).

string

The timestamp markup, such as <t:1762338600:R>.

c.reply(`The event starts ${time(start, 'relative')}`);