timestamp

how can I get the current time and add a certain number of milliseconds to it to get a timestamp?
7 Replies
d.js toolkit
d.js toolkit6mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
d.js docs
d.js docs6mo ago
:function: time @0.4.0 Formats a date into a short date-time string. :mdn: Date.now() The Date.now() static method returns the number of milliseconds elapsed since the epoch, which is defined as the midnight at the beginning of January 1, 1970, UTC. :mdn: Date() constructor The Date() constructor creates Date objects. When called as a function, it returns a string representing the current time.
vekizxo
vekizxoOP6mo ago
Math.floor(Date.now() +convertDurationToMS(duration))
Math.floor(Date.now() +convertDurationToMS(duration))
?
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
vekizxo
vekizxoOP6mo ago
how example pls
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
NyR
NyR6mo ago
They kinda have to use that, Date.now() returns timestamp in ms, time function expect it in seconds, so division by 1000 would require it ig, just better yet, pass time(new Date()) and djs will do the conversion for you
Want results from more Discord servers?
Add your server