How to optimize the time of the site?

Is the server is in Russia, respectively, time (timezone) is taken from the location server(Moscow). When entering from other countries, Tyson shows the time location of the server, not the country or tisone. How it's done, and in what ways ?
For example, social networks show the time zone where the person is located.
July 4th 19 at 23:18
3 answers
July 4th 19 at 23:20
Solution
I use https://www.npmjs.com/package/jstz
Defines timzone on the client side.
Example usage: https://jsfiddle.net/5ybsto18/
var tz = jstz.determine();
var timezone = tz.name();
July 4th 19 at 23:22
In social networks indicated the city of thy dwelling place, therefore it is not difficult in the database to see what city what timezone. In your case you need to combine geoip and timezone.
you can detail how to do this ? - Rylee11 commented on July 4th 19 at 23:25
July 4th 19 at 23:24
var t = new Date();
t.setTime(<?= strtotime('now') ?>);
write(t.toLocaleTimeString());

Find more questions by tags MySQLPHPTime management