For example, I want to set a variable to 4 pm, where it will be 4 pm for everyone. I'm sure there will be some sort of solution for that, a real-world example is, you set a calendar event for 4 pm, and whoever is in that event will also receive the reminder at 4 pm of their timezones, how do we achieve it?
I've been googling and looking at the moment js docs but I couldn't figure it out yet, any thoughts?
I've been working on this jsFiddle but I don't think this is the path, https://jsfiddle.net/wmoreiradev/y70Lnmzb/7/
const utcOffset = new Date().getTimezoneOffset();
const date = moment('2020-06-24T23:45:00.000Z').utcOffset(utcOffset).toDate();
What you're trying to achieve is ambiguous, as 4 PM in all timezone is just simply doesn't exist at the same time.
BUT, for any reason, if you want to do it, you can do it, just pass the date as a simple string out it in the simple string. From simple string, I mean not a date object.
moment("4:00PM", "hh:mmA").format();
It will always give you 4:00PM
in all the timezone.