Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2
new Date().getTimezoneOffset() will give you the offset from UTC in minutes for the client, you can do your own calculation to display it properly. Intl.DateTimeFormat().resolvedOptions().timeZone will give you the name of the timezone of the client if you wish to display that as well ie. "America/Los_Angeles"
2nd Jun 2020, 6:38 PM
JME