How do I convert UK endDate to UTC so that I can compare with UTC current time (nowTime) on node? or is it better to do it other way around? convert current UTC time to London timezone and then do a comparison with UK endDate
For example:
const nowTime = new Date('Thu May 10 2020 15:55'); //mock now time in UTC
const date = { //this is london date/time
EndDate: "2020-05-10",
EndTime: "15:57",
}
const combineDateTime = date.EndDate + " " + date.EndTime;
const endDate = new Date(combineDateTime).getTime();
if (nowTime >= endDate) {
console.log('expired');
} else {
console.log('not expired')
}