I'm trying to include actual date and time to the certain message, however I'm unable to do it, because moment.js keeps stucked at the same time. For some reason it only triggers the same time over and over again when script was started.
//require moment + time format
var moment = require('moment');
var todaymoment = moment().format('L, hh:mm:ssa');
//Check the current time each 5 seconds and update message
setInterval(function () {
message.edit({ embeds: [currentTime.setDescription('Current time is: ' + todaymoment) && currentTime.setTitle('Time Updated!')] })
console.log(todaymoment)
}, 5000)
})
logs:
04/01/2022, 03:30:23am
04/01/2022, 03:30:23am
04/01/2022, 03:30:23am
04/01/2022, 03:30:23am
I also tried different library, but results are same.
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)