Setting Date and Time

From Openmoko

Revision as of 00:48, 17 July 2008 by Jabski (Talk | contribs)

Jump to: navigation, search

Setting date from the command prompt

To change the date on your Freerunner you have to give the command

date -s MMDDhhmm

or

date -s MMDDhhmmYYYY

or

date -s MMDDhhmmYYYY.ss

where MM is the month, 01-12; DD is the day, 01-31; hhmm is the time, 0000-2359; YYYY is the optional year, and .ss is the optional seconds.

If your Freerunner is connected to the internet, you can instead set the time automatically:

 opkg install ntpclient
 ntpclient -s -h pool.ntp.org

Presumably it might also be possible to use gpspipe (or something else) to set the date once you have a gps fix?

Finally, sync the hardware clock with the system time to make your change persist over reboots:

hwclock --systohc

See also Timezone for changing the time zone.

Personal tools

Setting date from the command prompt

To change the date on your Freerunner you have to give the command

date -s MMDDhhmm

or

date -s MMDDhhmmYYYY

or

date -s MMDDhhmmYYYY.ss

where MM is the month, 01-12; DD is the day, 01-31; hhmm is the time, 0000-2359; YYYY is the optional year, and .ss is the optional seconds.

If your Freerunner is connected to the internet, you can instead set the time automatically:

 opkg install ntpclient
 ntpclient -s -h pool.ntp.org

Presumably it might also be possible to use gpspipe (or something else) to set the date once you have a gps fix?

Finally, sync the hardware clock with the system time to make your change persist over reboots:

hwclock --systohc

See also Timezone for changing the time zone.