Ardunio Yun time process "date" command info?

Hello everyone,

i was searching the internet for hours, but i couldn't find the information i need.
It is about the time process with the "date" command.

for example:

Process time;
  time.begin("date");
  time.addParameter("+%T");

My question is: Where does the time process get the information of the time from?
I heard he gets it from the network, but does every network have a time? or does he get it from a timeserver on the network?

You see i am very confused, so i would be thankful if you could help me a little :smiley:

Thanks in advance,
codetech

date gets the date from the system (sorry I don't have enough culture to explain it better)
system date gets updated using time servers (that use "ntp": "network time protocol")
if your yun can access internet, date will be something like june 2014 etc, if not it will be something like jan 1970..

Thank you for the quick response.

I think i understand it better now:
process date runs a command on the linux-system and returns the "linux-date"
the "linux-date" gets automatically updated via ntp when the yun is connected to a network with access to internet.
So what happens if i have no access to the internet on my network? Do i have to set up a time-server manually?
Can i tell the yun which time-server it should use?

Thanks in advance,

codetech

codetech:
So what happens if i have no access to the internet on my network? Do i have to set up a time-server manually?

You'll get something like 1st January 1970. See Unix time - Wikipedia

codetech:
Can i tell the yun which time-server it should use?

Yes, they are listed in file /etc/config/system. Look for openwrt documentation about how to work with file in /etc/config/

codetech:
...
So what happens if i have no access to the internet on my network? Do i have to set up a time-server manually?
...

Offline support required real-time clock (RTC)

http://forum.arduino.cc/index.php?topic=231712.msg1725255#msg1725255

http://playground.arduino.cc/Main/DS1302