I have this:
let today = new Date()
let todayMinusFive = today.setHours(today.getHours() - 5);
it is taking the current time and then subtract 5 hours from it to get the time in EST. logging this will get me an epoch time.
then what i am doing is this:
let myTime = new Date(today.getFullYear(), today.getMonth(), today.getDay(), hour, minute);
and what this does is take the current date with my variables of hour and minute defined in there, which are properly split above. After this, I do this:
myTime = Math.floor(myTime / 1000)
this again now gives me the epoch time for my time from the database with hour and minute.
What I then want to do is subtract the two:
if (todayMinusFive - myTime <= 5) {
console.log("doing logic")
}
but the problem is it isn't working. i know for a fact that the time difference is less then 5, and it is saying it is this huge number like 16000 or something. What am i doing wrong?