Leader board which maintains different time zones ?

HI All,

Firstly i know that the question which i am going to post is not confined only to unity, but the reason of posting it here is that it could get direct response from the game dev world.

I am creating a dice based game which consist of a leader board system where we have separate table for top 20 entries in a day,month,year and all time.

Now the issues which i am facing is related to Time Zone,Suppose i am playing in USA and it’s currently tuesday at my place but at the same time a user is playing in some asian country which is around 10 hours ahead of me and he is currently in wednesday. Then on which table should i store the scores to wednesday or tuesday.

and when user wants to see the top users of the day, which day scores will he see in his respective time zone.

Firstly i thought of taking a standart time but it didn’t seem to be the right approach to me.

You will be best off storing all times in UTC (universal standard time) and localising them from there. Storing times in UTC is pretty standard.

You will probably want to use the DataTime class for this. In particular, take a look at DateTime.ToLocalTime, DateTime.ToUniversalTime, and DateTime.Now.

Also: Make sure you use constant locale when getting string values of your dates. 2013/3/21 is a valid (and correct) date in Japan, 21/3/2013 in UK(/Europe?) and 3/21/2013 in America. Note that I chose dates that can’t be confused, but consider 12/11/10!

Think of it this way. Rather than having top 20 entries in a day, have a table that shows the top 20 entries in the last 24 hours. Convert all the dates from the players local time zone into UTC and store those in the database. If you show the times to the user, then convert them from UTC into the local timezone.