how can i synchronize the time in the game with the real-time on the server
You would use
Network.time
This will tell you the exact time the server says it is. You can use this along with info.timestamp from a networkviewserialize to determine the time it took for the data to arrive.
See link below for more details.
http://unity3d.com/support/documentation/ScriptReference/Network-time.html
function Update() {
var dt : System.DateTime = System.DateTime.Now;
var h : int = dt.Hour;
var m : int = dt.Minute;
var s : int = dt.Second;
print(dt);
print(h + " " + m + " " + s);
}
Always wondered this too =) Thanks.
http://forum.unity3d.com/threads/55738-How-to-get-current-System-time-in-unity-using-java-script