Setting the System Time

From wiki.emacinc.com
Revision as of 18:19, 3 October 2013 by Kyoungmeyer (talk | contribs)
Jump to: navigation, search
TODO: {{#todo:Port and polish and finish|Klint Youngmeyer|oe 4,oe 5,ky}}


Setting the System Time on EMAC OE Products

During boot, they system will call the program ntpdate to set the time from an NTP server. This requires that the device has Internet access. To do this manually run the following command:

$ ntpdate pool.ntp.org

The example above uses the server pool.ntp.org which will retrieve a randomly chosen public NTP server. However, the choice of time server is arbitrary and can be set according to the users' needs. If the device does not have Internet access, then the system date can be set using the following command:

$ date -s "<date_format>"

The argument <date_format> can be any of the following:

"hh:mm[:ss]"
"[YYYY.]MM.DD-hh:mm[:ss]"
"YYYY-MM-DD hh:mm[:ss]"
"MMDDhhmm[[YY]YY][.ss]"

hh = hour
mm = minute
ss = second
YYYY = four-digit year
MM = month
DD = day
[YY]YY = four-digit year where the first two digits are optional



On shutdown the system time is saved to the hardware clock automatically with the following command:

/etc/init.d/hwclock.sh stop

To do this manually after setting the date run the following command:

/etc/init.d/hwclock.sh restart