const getTimezoneOffset = (timeZone = 'UTC', date = new Date()) => {
try {
const utcDate = new Date(date.toLocaleString('en-US', { timeZone: 'UTC' }));
const tzDate = new Date(date.toLocaleString('en-US', { timeZone }));
return (tzDate.getTime() - utcDate.getTime()) / 6e4;
}
catch {
console.log(`ERROR: Invalid Timezone Name - ${timeZone} / Fallback Offset: +0`);
return 0;
}
}