Getting the time...

I would like to do the following:

  • determine if the computer is connected to the internet
  • if yes, make SNTP requests to several NTP time servers and parse the replies
  • if no, look for some “standard” system file that should be modified today and get the modified date
  • AND if no, look at the local time for the machine

I am not yet very familiar with any system related calls in the context of Unity… and this is all proving much harder than I had hoped.

Does anybody have any starting advice on how to implement this in Unity – I understand in theory how to implement it, and I could do it in a number of ways… but I get this massive conceptual wall whenever I try to implement it in C#.

Nevermind… forced myself to just go through it step by step.

Although… does anyone know of a good resource for doing any Mono/.NET system related stuff? For reference outside of the Unity-specific manuals.

So how did you do it?
Is there a way to get the system time through Javascript?

i found a simple example , worked for me.
p.

http://forum.unity3d.com/viewtopic.php?t=4559

I used

import System;

date = DateTime.Now;

That works too.