'Convert date/time in email from UTC to a user's local timezone

I work on an application that sends out automated emails notifying users of when an event will end, e.g.

Hey,

That event you're interested in will end on 2021-01-01 at 10PM UTC.

Users of this application can be located anywhere in the world and some of them are having difficulty converting the UTC date/time to their local timezone. I'm looking for suggestions about how this problem could be mitigated? Obviously when the email is composed there's no way of knowing in which timezone the recipient will be based.

One idea is to link the date/time in the email to a web site/service that can convert a UTC date/time to the user's local timezone, i.e. when you click on this link it makes a GET request that includes the UTC date/time in the URL (or params) and returns the local date/time. This assumes that

  • such a web service exists (if it doesn't, I'm not going to implement one myself)
  • the user's time zone can be detected from the request headers send by their email client

Is this web service idea feasible or is there any other way that I can help users to convert the UTC date/time in the email into their local timezone?



Solution 1:[1]

Such a web service does exist, for example have a look at the APIs provided by timeanddate.com.

It looks like you could get away with building a simple link to their website if that is acceptable to the recipients.

https://www.timeanddate.com/worldclock/fixedtime.html?msg=Event%20Title&iso=20220517T09&p1=129&am=45

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 dougwoodrow