How to set time and date


6 posts
by brianjester » Thu Jan 10, 2013 7:42 am
I didn't see an option to set the time and date on the raspi-config menu, only locale and timezone. Is there (a non command line way) to set time with the Wheezy distros from the GUI?

My workaround was to set time/date with: "sudo date -u MMDDhhmmCCYY"

Brian Jester
Brian Jester
Posts: 6
Joined: Wed Jan 09, 2013 5:51 pm
Location: Alaska
by Joe Schmoe » Thu Jan 10, 2013 7:59 am
brianjester wrote:I didn't see an option to set the time and date on the raspi-config menu, only locale and timezone. Is there (a non command line way) to set time with the Wheezy distros from the GUI?

My workaround was to set time/date with: "sudo date -u MMDDhhmmCCYY"

Brian Jester


Since the Pi has no RTC, setting the time is a per-boot activity, not a config activity. So, one way or another, you will have to execute a command line to set it, on each boot.

"normally", this is done by the boot scripts, once a network connection has been made. But this doesn't work ("normally") if your boot-up sequence doesn't get you a network connection (as is the case for me). So, I have to use the "rdate" command after having made the network connection.
Never answer the question you are asked. Rather, answer the question you wish you had been asked.

- Robert S. McNamara - quoted in "Fog of War" -
Posts: 2859
Joined: Sun Jan 15, 2012 1:11 pm
by jheaton5 » Thu Jan 10, 2013 9:09 am
the debian package ntpdate is a deamon that automatically sets the clock from an NTP server. It will keep you pi's clock up to date and automatically sets the clock on each reboot or cold start.
User avatar
Posts: 23
Joined: Mon Dec 24, 2012 3:33 pm
by Joe Schmoe » Thu Jan 10, 2013 10:09 am
jheaton5 wrote:the debian package ntpdate is a deamon that automatically sets the clock from an NTP server. It will keep you pi's clock up to date and automatically sets the clock on each reboot or cold start.


Yes - but only if you have a network connection (at the time of boot!)

That's the whole point.
Never answer the question you are asked. Rather, answer the question you wish you had been asked.

- Robert S. McNamara - quoted in "Fog of War" -
Posts: 2859
Joined: Sun Jan 15, 2012 1:11 pm
by PhillyNJ » Thu Jan 10, 2013 11:17 am
FWIW - in the US the time zone needs to be set:

Code: Select all
sudo dpkg-reconfigure tzdata


This will give you a GUI to set the time zone.
Posts: 109
Joined: Sat Dec 29, 2012 4:07 am
by SirLagz » Thu Jan 10, 2013 1:59 pm
fake-hwclock will at least give you an approx time as long as there's not too much downtime between boots without network connectivity....
Combine that with ntp and you should be right !
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044
Posts: 1704
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia