How does js calculate the time from local time to Beijing time (UTC+8) at 20:00 on Friday?

as mentioned in the question, 20:00 Beijing time (UTC+8) on Friday is a time point, how to calculate the hours and seconds of each time zone ending Beijing time (UTC+8) at 20:00 on Friday? For example, what are the minutes and seconds when people are in New York? What is the minute and second when people are in Tokyo? What are the minutes and seconds when people are in Singapore?

Jun.02,2022

20:00 Beijing time (UTC+8) on Friday is a fixed timestamp. You can get the current timestamp with new Date (). Just subtract it. There is no time zone problem. The timestamp is the same in different time zones. It's just that there is a difference when the timestamp is converted to minutes and seconds


getTimezoneOffset

Menu