using System; namespace GFGGame { public class ServerDataManager { private const long TIME_ORIGINAL = 621355968000000000; private static long _dTime; public static void SetServerTime(long serverTime) { _dTime = serverTime - CurrentlocalTime; } public static long currentTimeMillis { get { return CurrentlocalTime + _dTime; } } public static int currentTimeSecs { get { return (int)currentTimeMillis/1000; } } public static long CurrentlocalTime { get { return (DateTime.Now.Ticks - TIME_ORIGINAL)/10000; } } public static int CurrentDay { get { DateTime dateTime = new DateTime(currentTimeMillis*10000 + TIME_ORIGINAL); return dateTime.Day; } } } }