0

I'm making a alt detection system for my discord server. and I'm making an Account Age here is the code for it. It sends milliseconds but the createdAt for other parts of the embed works but not the difference string. I'm using V13 Discord.js MS Node Package

const createdAt = new Date(member.user.createdAt).getTime();
const difference = Date.now() - createdAt;

Picture https://i.stack.imgur.com/Vk7Gl.png

MrKlaus
  • 13
  • 2

1 Answers1

-1

This might help: if member.user.createdAt is already in DateTime format than

const createdAt = new (member.user.createdAt).getTime();
const difference = new Date(Date.now() - createdAt);
  • How does this help? How do you get any sensible formatting for age out of it? – gre_gor Feb 17 '22 at 04:56
  • This might help in understanding const moonLanding = new Date('July 20, 69 20:17:40 GMT+00:00'); // milliseconds since Jan 1, 1970, 00:00:00.000 GMT console.log(Date(Date.now() -moonLanding.getTime())); // expected output: "Thu Feb 17 2022 10:41:17 GMT+0500 (Pakistan Standard Time)" – muhammad saad Feb 17 '22 at 05:43
  • When I tried that it shows this now. https://gyazo.com/1540940641d4180315bc8b47c5b8bc4b – MrKlaus Feb 18 '22 at 02:21