Multi-time zone solutions for games across time zones

foreword

When the game is operating, it will encounter problems across time zones. For example, opening a new server in a new region, or opening a regional or global server.
This article analyzes solutions across time zones.

text

server time

Server time is a very important parameter. Since the system time of each terminal device is inconsistent, a server time needs to be synchronized to the client.
The server time generally uses an offset (timestamp) from January 1, 1970 00:00:00 GMT, and the client records a time difference.
Then the client calculates the display time by taking the system time zone.

Client configuration

If all time-related parameters are configured on the server side, and the client side uses synchronous data, there is generally no trouble.
But assuming a pure client function with a time open switch, if the configuration is filled in a format similar to 2017-10-15 18:21:50,
for example, a client in East Nine District and a client in East Eight District If the client runs at the same time, the client in Dongjiu District will open one hour earlier than the client in Dongba District, because the time in Dongjiu District is one hour longer than that in Dongba District.
Solution:
1. Fill in the timestamp directly in the configuration table.
2. The server sends the server time zone, and the date and time in all configurations are offset.

Summer time

In addition to time zones, there is another term that cannot be ignored: daylight saving time .
Our country has abolished daylight saving time in 1992, but if it is in countries such as the United States and Europe, this cannot be ignored.
Countries in the same time zone, one that adopts daylight saving time and one that does not, have different times.
The best solution to this problem, of course, is to use the timestamp sent by the server for all the client's time, and then convert it to the local display time.
Of course, if the planning children's shoes do not configure the timestamp, the server can convert it through the artificially specified time zone.


If there are any mistakes, please point them out.

email:dxmdxm1992#gmail.com

blog: csdn: magician david xiaomingjun

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325479710&siteId=291194637