Arya Anish
Arya Anish

Reputation: 85

Add a date-time description in discord.js

How do I create a date-time description like this, in discord.js? I tried to use timestamp but it adds the date to the footer

enter image description here

Upvotes: 2

Views: 6287

Answers (1)

0x464e
0x464e

Reputation: 6489

It's the new (over half a year old by now) timestamp formatting syntax.
From the official documentation:

Formats

Type Structure Example
.... .... ....
Unix Timestamp <t:TIMESTAMP> <t:1618953630>
Unix Timestamp (Styled) <t:TIMESTAMP:STYLE> <t:1618953630:d>

Timestamps will display the given timestamp in the user's timezone and locale.

Timestamp Styles

Style Example Output Description
t 16:20 Short Time
T 16:20:30 Long Time
d 20/04/2021 Short Date
D 20 April 2021 Long Date
f * 20 April 2021 16:20 Short Date/Time
F Tuesday, 20 April 2021 16:20 Long Date/Time
R 2 months ago Relative Time

* default

Upvotes: 3

Related Questions