Home > Mobile >  Add timestamp in description in discord.js
Add timestamp in description in discord.js

Time:02-26

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

enter image description here

CodePudding user response:

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

  • Related