I’m dealing with sending emails to users in unknown locations and embedding times into these emails. Is there an HTML element that will just display a UTC time as local time? I know I could use JavaScript, but that would not be OK for email.
I’m dealing with sending emails to users in unknown locations and embedding times into these emails. Is there an HTML element that will just display a UTC time as local time? I know I could use JavaScript, but that would not be OK for email.
2
Answers
Sorry, but the answer is no. There is currently not an HTML tag that will display a UTC time converted to the user’s local time zone. The closest would be the
<time>
tag, but it does not perform any conversions or formatting. Even if such a tag existed, it would also have to be supported by email applications to be useful for the scenario you described.The better approach would be to state clearly the date and time in UTC within the email, using an unambiguous format.
Or, if the date and time is in reference to an event that has a specific time zone and physical location, use that instead.
As you say, there is not HTML element doing that, and you cannot place Js into an email, so, you have 2 solucions:
Send the unique time of the meeting or the event, speicifyng the time zome.
Or second, if you have the timezone of your clients, tarnsform the date in the server (while seting up the email) and send both datetimes in client timezone and in event’s location timezone.
Al ways include the original event location timezone to voy a missunderstanging.
Or include some great graphics of allyour clients timezones and original event timeze (if there quite a bit), and like so you do only one conversion of times, with a good graphic and easy to understand.
The important here is how easy is for your clients get the correct data.