I'm trying to get the current date (day, hour, minute, second) and put it in an if() statement to compare it with the date entered. But how am I able to get the date and ask for it in code?
This is what I got so far:
bot.on("ready", () => {
var today = new Date();
var date = today.getFullYear() + '-' + (today.getMonth() + 1) + '-' + today.getDate();
var time = today.getHours() + ":" + today.getMinutes();
var currentdate = date + time
var endDate = new Date('2021-01-21T14:00:00')
if (endDate = currentdate) {
console.log('The time has come..')
} else {
console.log('The time is coming soon..')
}
})