| Setting
Date and Time on a Debian Server
Computers have a clock
to keep time. Usually there is a hardware clock with battery backup
to keep time when the computer is off. The operating system (for
example Linux) runs its own clock, and from this clock comes the
time shown by commands such as date in Linux and time in DOS.
The hardware clock is usually accurate enough, provided
that the battery has not run out. If the time shown by the computer
when you turn it on is wrong by several months or years, it is worth
checking if the battery is still usable.
The "software" clock in the operating
system usually has drift, either systematic or random. This drift
means the clock runs too fast or too slow. For this reason it is
nesessary to use some accurate time source to syncronize the operating
system clock if accurate time is needed.
To see the time on Debian GNU/Linux, use the command
date. For example
$ date
Fri Oct 23 04:45:51 EEST 1998
The above command shows the day of the week, the
month, the day of the month, the time, the time zone and the year.
The time zone also shows whether Daylight Saving Time is in use
(in the example, the base time zone is EET,and the extra S means
Saving).
In Debian GNU/Linux and other Unix, the command
time does not show time. It is used to time command excecutions.
If you have some command that takes a fair amount of time to execute,
and you do not feel like standing by with a stopwatch, you can see
how long it took by running the command as argument to time. This
example may clear things up:
$ time sleep 60
real 1m0.045s
user 0m0.000s
sys 0m0.000s
Setting Dates on a Debian Server
date --set 2006-03-14
date --set 12:02:0
|