troubleshooting Question

Handle the day light saving and display local time of an event correctly

Avatar of Pritam Bagul
Pritam Bagul asked on
Web DevelopmentJavaScript
6 Comments1 Solution19 ViewsLast Modified:
Dear Friends,

I seek help in handling a scenario where we have API fields such as
UtcDateTime"2019-07-12T02:00:00"
Date   "2019-07-12"
Time"11:00:00"
TimeZone"09:00:00"
TimeZoneDisplayName"Korea Standard Time"

Our requirement is to display the event in local time.
Based on above example; if the event in Korea starts at 11:00; then the display time in Swiss must be 04:00.
We were using the timezone field from API and using the UTC offset in javascript to calculate the local time. However, this does not handle the day light savings case.

For this the source has added a new field UTCDateTime that will always store the event time in UTC time and requires us to use this field to display the local time correctly irrespective of day light savings ON/OFF.

Please help us with a logic to deal with this.

regards

ASKER CERTIFIED SOLUTION
ste5an
Senior Developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros