I know that Raspberry Pi does not come with a system clock to save money. How can I keep system time though?
The most popular method of keeping system time is via the Network Time Protocol daemon (NTPd).
NTPd should already be installed and set up on the default operating system, Debian Squeeze. You will need to install and configure it manually though for Arch Linux.
First you should install NTP.
Now you can manually update it via the command line.
Or you can add it to the list of daemons on start up by adding it to your
Note that you need to disable
Protip from mlp: If you add
If you want to guarantee that the time on the RPi is always correct or want to maintain the time without a network connection, you will need to buy an expansion board with a Real Time Clock (RTC) on it: there is at least one available and at least one in development.
Available RTC Expansion Boards
RTC Expansion Boards in Development
For non-networked applications (or where network time might not be good enough), you can set your RTC clock (@Alex Chamberlain's answer) with time derived from a GPS receiver or a VLF receiver (in NW Europe this would be Rugby MSF). Both could be excellent solutions to field-deployed devices (robots, field monitoring, etc).
Both solutions would also make good hobby projects. I remember building a Rugby MSF receiver in the 1980s. An off the shelf GPS receiver ("puck") would give the time and date in the NMEA 0183 sentences - it would then be a simple coding project to extract this information.
Install the NTP daemon on Arch Linux with systemd:
Also make sure your timezone is set correctly, in my case: