Is there a way to get the Server Time?

+1 vote

I would like to know if there is a way to get the server time, I've tried using custom server code, but I cant use System.currentTimeMillis() , is there a way to achieve this?

Im Using Unity3d.

 Thanks in Advance
asked Apr 23, 2014 in App42 Cloud API-BaaS by chrystiansilva (33 points)

1 Answer

0 votes
I've found I can use Calendar and DateFormat, so I've already solved it.

Thanks anyway.
answered Apr 23, 2014 by chrystiansilva (33 points)
If theres is a better way I would like to know it.

Yes you are doing good to get server time.
I am also using Unity 3D. Can you explain the logic for getting the server time in shephertz?
in unity3d you can get server time like this.

/// <summary>
       /// Finds the current time
       /// </summary>
       /// <returns>Time format</returns>
       public static String GetUTCFormattedTimestamp()
           DateTime datTimeUTC = DateTime.Now.ToUniversalTime();
           DateTime dt = new DateTime(datTimeUTC.Year, datTimeUTC.Month, datTimeUTC.Day, datTimeUTC.Hour, datTimeUTC.Minute, datTimeUTC.Second, datTimeUTC.Millisecond);
           return String.Format("{0:yyyy-MM-dd'T'HH:mm:ss.fff'Z'}", dt);
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on