How can I turn a joinedTimestamp into this Discord Timestamp

The one that automatically shows you like how long ago this timestamp was
Solution:
Discord.js
Discord.js is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
Jump to solution
14 Replies
chillihero
chillihero2y ago
Do you have a utility for this?
Seren_Modz 21
Seren_Modz 212y ago
u can import the time function from discord.js
Solution
Seren_Modz 21
Seren_Modz 212y ago
Discord.js
Discord.js is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
Ararou 🍭
Ararou 🍭2y ago
<t:<Date>:F> replace <Date> with your valid Unix time stamp
chillihero
chillihero2y ago
i played around with it a bit and have the following problem the timestamp 1677687907708 converts to this when using a unix tool, watch the date 2023
chillihero
chillihero2y ago
But when using it in discord, I get a super wierd date in the future
chillihero
chillihero2y ago
chillihero
chillihero2y ago
<t:1677687907708:R> <t:1677687907:R>
Krish
Krish2y ago
<t:1677687907:R> divide it by thousand and you are good
chillihero
chillihero2y ago
why is that
Krish
Krish2y ago
Because Unix timestamps includes milliseconds but discord doesn't
chillihero
chillihero2y ago
and discord sends unix timestamps
Krish
Krish2y ago
I am talking about <t:timestamp> notation
chillihero
chillihero2y ago
this is wierd behaviour lol but ill take it thanks!