discord_bot/util/getCreationDate.js
SileNce5k 8b92667315
Add leading zeros and add one to month
Forgot about the fucking padding and month not being correct because
fuck javascript. Hopefully I didn't forget about anything else.
2021-06-27 20:14:46 +02:00

4 lines
No EOL
259 B
JavaScript

module.exports = function(user){
let date = user.createdAt;
return date.getUTCFullYear() + '-' + ('0' + (date.getUTCMonth()+1)).slice(-2) + '-' + ('0' + date.getUTCDate()).slice(-2)+" "+date.getUTCHours()+":"+date.getUTCMinutes()+":"+date.getUTCSeconds();
}