Answer the question
In order to leave comments, you need to log in
How to optimize website time?
There is a server located in Russia, respectively, the time (timezone) is taken from the location of the server (Moscow). When logging in from other countries, the timezone shows the time and location of the server, not the country or timezone. How is it done, what are the ways?
For example, social networks show the time zone where a person is.
Answer the question
In order to leave comments, you need to log in
I'm using https://www.npmjs.com/package/jstz
Defines timezones on the client side.
Usage example: https://jsfiddle.net/5ybsto18/
var tz = jstz.determine();
var timezone = tz.name();
In social networks, the city of your habitat is indicated, so it’s not difficult to see which city has which timezone in the database. In your case, you need to combine geoip and timezone.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question