+ 2
How do I show different timezones in Javascript???
I am trying to make a code that shows different times from different timezones(India,UK,USA,Japan...etc).Can you pls show me a way how to do that? Thanks..
4 Réponses
+ 4
As said on stack-overflow.
It is not happening with pure JavaScript.
But with use of library of JS, you can easily do it.
https://stackoverflow.com/questions/18645788/javascript-display-various-time-zones
+ 2
Hi DCODER,
To get the timezone of the client, you can work with the getTimezoneOffset() method which returns the time difference between UTC time and local time
If your clients time zone is GMT+1, -60 will be returned.
+ 2
Thanks guys..😁
+ 1
Well, if you think of using js, get the client geolocation and make a 24-switch function for the 24 zones...a zone is a group of 15 longitudes