]> git.ipfire.org Git - thirdparty/util-linux.git/blame - hwclock/hwclock.8
getopt.1: formatting
[thirdparty/util-linux.git] / hwclock / hwclock.8
CommitLineData
28e984a4 1.TH HWCLOCK 8 "06 August 2008"
fd6b7a7f 2.SH NAME
22853e4a 3hwclock \- query and set the hardware clock (RTC)
fd6b7a7f 4.SH SYNOPSIS
28e984a4 5.BR "hwclock [functions] [options]"
fd6b7a7f
KZ
6
7.SH DESCRIPTION
66ee8158 8.B hwclock
fd6b7a7f
KZ
9is a tool for accessing the Hardware Clock. You can display the
10current time, set the Hardware Clock to a specified time, set the
11Hardware Clock to the System Time, and set the System Time from the
12Hardware Clock.
13.PP
9abb2685
KZ
14You can also run
15.B hwclock
fd6b7a7f
KZ
16periodically to insert or remove time from the Hardware Clock to
17compensate for systematic drift (where the clock consistently gains or
18loses time at a certain rate if left to run).
19
28e984a4 20.SH FUNCTIONS
9abb2685
KZ
21You need exactly one of the following options to tell
22.B hwclock
fd6b7a7f
KZ
23what function to perform:
24.PP
25.TP
28e984a4 26.B \-r, \-\-show
fd6b7a7f 27Read the Hardware Clock and print the time on Standard Output.
c07ebfa1 28The time shown is always in local time, even if you keep your Hardware Clock
7eda085c
KZ
29in Coordinated Universal Time. See the
30.B \-\-utc
31option.
32
fd6b7a7f
KZ
33.TP
34.B \-\-set
9abb2685 35Set the Hardware Clock to the time given by the
fd6b7a7f
KZ
36.B \-\-date
37option.
38.TP
28e984a4 39.B \-s, \-\-hctosys
9abb2685 40Set the System Time from the Hardware Clock.
5c36a0eb 41
22853e4a
KZ
42Also set the kernel's timezone value to the local timezone
43as indicated by the TZ environment variable and/or
a2c5f3ca 44.IR /usr/share/zoneinfo ,
9abb2685 45as
7eda085c 46.BR tzset (3)
22853e4a
KZ
47would interpret them.
48The obsolete tz_dsttime field of the kernel's timezone value is set
49to DST_NONE. (For details on what this field used to mean, see
50.BR settimeofday (2).)
5c36a0eb
KZ
51
52This is a good option to use in one of the system startup scripts.
fd6b7a7f 53.TP
28e984a4 54.B \-w, \-\-systohc
fd6b7a7f
KZ
55Set the Hardware Clock to the current System Time.
56.TP
88a3372e
SJR
57.B \-\-systz
58Reset the System Time based on the current timezone.
59
60Also set the kernel's timezone value to the local timezone
61as indicated by the TZ environment variable and/or
62.IR /usr/share/zoneinfo ,
63as
64.BR tzset (3)
65would interpret them.
66The obsolete tz_dsttime field of the kernel's timezone value is set
67to DST_NONE. (For details on what this field used to mean, see
68.BR settimeofday (2).)
69
70This is an alternate option to
71.B \-\-hctosys
72that does not read the hardware clock, and may be used in system startup
73scripts for recent 2.6 kernels where you know the System Time contains
74the Hardware Clock time.
75.TP
fd6b7a7f
KZ
76.B \-\-adjust
77Add or subtract time from the Hardware Clock to account for systematic
78drift since the last time the clock was set or adjusted. See discussion
79below.
80.TP
2b6fc908 81.B \-\-getepoch
5213517f 82Print the kernel's Hardware Clock epoch value to standard output.
2b6fc908
KZ
83This is the number of years into AD to which a zero year value in the
84Hardware Clock refers. For example, if you are using the convention
85that the year counter in your Hardware Clock contains the number of
86full years since 1952, then the kernel's Hardware Counter epoch value
87must be 1952.
88
89This epoch value is used whenever hwclock reads or sets the Hardware Clock.
90.TP
91.B \-\-setepoch
92Set the kernel's Hardware Clock epoch value to the value specified by the
93.B \-\-epoch
94option. See the
95.B \-\-getepoch
96option for details.
97.TP
28e984a4 98.B \-v, \-\-version
9abb2685
KZ
99Print the version of
100.B hwclock
fd6b7a7f 101on Standard Output.
fd6b7a7f
KZ
102.TP
103.B \-\-date=date_string
a2c5f3ca
KZ
104You need this option if you specify the
105.B \-\-set
106option. Otherwise, it is ignored.
107This specifies the time to which to set the Hardware Clock.
108The value of this option is an argument to the
66ee8158 109.BR date (1)
a2c5f3ca
KZ
110program.
111For example,
fd6b7a7f
KZ
112.sp
113.I hwclock --set --date="9/22/96 16:45:05"
7eda085c 114.sp
9abb2685
KZ
115The argument is in local time, even if you keep your Hardware Clock in
116Coordinated Universal time. See the
66ee8158 117.B \-\-utc
7eda085c
KZ
118option.
119
2b6fc908
KZ
120.TP
121.B \-\-epoch=year
122Specifies the year which is the beginning of the Hardware Clock's
123epoch. I.e. the number of years into AD to which a zero value in the
c07ebfa1
KZ
124Hardware Clock's year counter refers. It is used together with
125the \-\-setepoch option to set the kernel's idea of the epoch of the
126Hardware Clock, or otherwise to specify the epoch for use with
127direct ISA access.
2b6fc908 128
c07ebfa1 129For example, on a Digital Unix machine:
2b6fc908
KZ
130.sp
131.I hwclock --setepoch --epoch=1952
132
28e984a4
KZ
133
134.SH OPTIONS
fd6b7a7f
KZ
135.PP
136The following options apply to most functions.
137.TP
28e984a4 138.B \-u, \-\-utc
7eda085c
KZ
139.TP
140.B \-\-localtime
2b6fc908 141Indicates that the Hardware Clock is kept in Coordinated Universal
7eda085c
KZ
142Time or local time, respectively. It is your choice whether to keep
143your clock in UTC or local time, but nothing in the clock tells which
144you've chosen. So this option is how you give that information to
66ee8158 145.BR hwclock .
5c36a0eb 146
7eda085c
KZ
147If you specify the wrong one of these options (or specify neither and
148take a wrong default), both setting and querying of the Hardware Clock
149will be messed up.
150
151If you specify neither
152.B \-\-utc
153nor
154.B \-\-localtime
155, the default is whichever was specified the last time
66ee8158 156.B hwclock
7eda085c
KZ
157was used to set the clock (i.e. hwclock was successfully run with the
158.B \-\-set
9abb2685 159,
7eda085c
KZ
160.B \-\-systohc
161,
162or
163.B \-\-adjust
164options), as recorded in the adjtime file. If the adjtime file doesn't
165exist, the default is local time.
166
364cda48
KZ
167.TP
168.B \-\-noadjfile
169disables the facilities provided by
170.IR /etc/adjtime .
171.B hwclock
172will not read nor write to that file with this option. Either
173.B \-\-utc
174or
175.B \-\-localtime
176must be specified when using this option.
177
da82f6fe
KZ
178.TP
179.B \-\-adjfile=filename
180overrides the default /etc/adjtime.
181
88681c5f 182.TP
28e984a4 183.B \-f, \-\-rtc=filename
88681c5f
KZ
184overrides the default /dev file name, which is
185.IR /dev/rtc
186on many platforms but may be
187.IR /dev/rtc0 ,
188.IR /dev/rtc1 ,
189and so on.
190
fd6b7a7f 191.TP
2b6fc908 192.B \-\-directisa
7eda085c 193is meaningful only on an ISA machine or an Alpha (which implements enough
9abb2685 194of ISA to be, roughly speaking, an ISA machine for
66ee8158 195.BR hwclock 's
7eda085c 196purposes). For other machines, it has no effect. This option tells
66ee8158 197.B hwclock
2b6fc908 198to use explicit I/O instructions to access the Hardware Clock.
9abb2685 199Without this option,
66ee8158 200.B hwclock
2b6fc908
KZ
201will try to use the /dev/rtc device (which it assumes to be driven by the
202rtc device driver). If it is unable to open the device (for read), it will
203use the explicit I/O instructions anyway.
5c36a0eb 204
2b6fc908 205The rtc device driver was new in Linux Release 2.
7eda085c
KZ
206.TP
207.B \-\-badyear
208Indicates that the Hardware Clock is incapable of storing years outside
9abb2685 209the range 1994-1999. There is a problem in some BIOSes (almost all
7eda085c
KZ
210Award BIOSes made between 4/26/94 and 5/31/95) wherein they are unable
211to deal with years after 1999. If one attempts to set the year-of-century
212value to something less than 94 (or 95 in some cases), the value that
213actually gets set is 94 (or 95). Thus, if you have one of these machines,
66ee8158 214.B hwclock
7eda085c
KZ
215cannot set the year after 1999 and cannot use the value of the clock as
216the true time in the normal way.
217
218To compensate for this (without your getting a BIOS update, which would
9abb2685 219definitely be preferable), always use
7eda085c 220.B \-\-badyear
9abb2685 221if you have one of these machines. When
66ee8158 222.B hwclock
7eda085c 223knows it's working with a brain-damaged clock, it ignores the year part of
9abb2685 224the Hardware Clock value and instead tries to guess the year based on the
7eda085c 225last calibrated date in the adjtime file, by assuming that that date is
9abb2685 226within the past year. For this to work, you had better do a
7eda085c
KZ
227.I hwclock \-\-set
228or
229.I hwclock \-\-systohc
230at least once a year!
231
9abb2685 232Though
66ee8158 233.B hwclock
7eda085c
KZ
234ignores the year value when it reads the Hardware Clock, it sets the
235year value when it sets the clock. It sets it to 1995, 1996, 1997, or
2361998, whichever one has the same position in the leap year cycle as
237the true year. That way, the Hardware Clock inserts leap days where
238they belong. Again, if you let the Hardware Clock run for more than a
239year without setting it, this scheme could be defeated and you could
240end up losing a day.
241
66ee8158 242.B hwclock
9abb2685 243warns you that you probably need
7eda085c 244.B \-\-badyear
9abb2685 245whenever it finds your Hardware Clock set to 1994 or 1995.
7eda085c
KZ
246
247.TP
248.B \-\-srm
c07ebfa1
KZ
249This option is equivalent to
250.B \-\-epoch=1900
251and is used to specify the most common epoch on Alphas
252with SRM console.
7eda085c
KZ
253.TP
254.B \-\-arc
c07ebfa1
KZ
255This option is equivalent to
256.B \-\-epoch=1980
257and is used to specify the most common epoch on Alphas
258with ARC console (but Ruffians have epoch 1900).
7eda085c
KZ
259.TP
260.B \-\-jensen
261.TP
262.B \-\-funky\-toy
c07ebfa1
KZ
263These two options specify what kind of Alpha machine you have. They
264are invalid if you don't have an Alpha and are usually unnecessary
9abb2685
KZ
265if you do, because
266.B hwclock
267should be able to determine by itself what it's
eb63b9b8
KZ
268running on, at least when
269.I /proc
c07ebfa1
KZ
270is mounted.
271(If you find you need one of these options to make
9abb2685 272.B hwclock
c07ebfa1
KZ
273work, contact the maintainer to see if the program can be improved
274to detect your system automatically. Output of `hwclock --debug'
275and `cat /proc/cpuinfo' may be of interest.)
7eda085c 276
9abb2685 277.B \-\-jensen
7eda085c
KZ
278means you are running on a Jensen model.
279
9abb2685 280.B \-\-funky\-toy
7eda085c
KZ
281means that on your machine, one has to use the UF bit instead
282of the UIP bit in the Hardware Clock to detect a time transition. "Toy"
9abb2685 283in the option name refers to the Time Of Year facility of the machine.
7eda085c
KZ
284
285
2b6fc908 286.TP
fd6b7a7f 287.B \-\-test
2b6fc908
KZ
288Do everything except actually updating the Hardware Clock or anything
289else. This is useful, especially in conjunction with
fd6b7a7f 290.B \-\-debug,
9abb2685 291in learning about
66ee8158 292.B hwclock.
fd6b7a7f
KZ
293.TP
294.B \-\-debug
9abb2685
KZ
295Display a lot of information about what
296.B hwclock
fd6b7a7f
KZ
297is doing internally. Some of its function is complex and this output
298can help you understand how the program works.
299
300
301.SH NOTES
302
303
304.SH Clocks in a Linux System
305.PP
306There are two main clocks in a Linux system:
307.PP
9abb2685 308.B The Hardware Clock:
fd6b7a7f 309This is a clock that runs independently of any control program running
2b6fc908
KZ
310in the CPU and even when the machine is powered off.
311
312On an ISA system, this clock is specified as part of the ISA standard.
313The control program can read or set this clock to a whole second, but
314the control program can also detect the edges of the 1 second clock
315ticks, so the clock actually has virtually infinite precision.
fd6b7a7f
KZ
316.PP
317This clock is commonly called the hardware clock, the real time clock,
318the RTC, the BIOS clock, and the CMOS clock. Hardware Clock, in its
9abb2685
KZ
319capitalized form, was coined for use by
320.B hwclock
fd6b7a7f
KZ
321because all of the other names are inappropriate to the point of being
322misleading.
323.PP
88681c5f
KZ
324So for example, some non-ISA systems have a few real time clocks with
325only one of them having its own power domain.
326A very low power external I2C or SPI clock chip might be used with a
327backup battery as the hardware clock to initialize a more functional
328integrated real-time clock which is used for most other purposes.
329.PP
9abb2685 330.B The System Time:
fd6b7a7f 331This is the time kept by a clock inside the Linux kernel and driven by
2b6fc908
KZ
332a timer interrupt. (On an ISA machine, the timer interrupt is part of
333the ISA standard). It has meaning only while Linux is running on the
334machine. The System Time is the number of seconds since 00:00:00
335January 1, 1970 UTC (or more succinctly, the number of seconds since
3361969). The System Time is not an integer, though. It has virtually
337infinite precision.
fd6b7a7f
KZ
338.PP
339The System Time is the time that matters. The Hardware Clock's basic
340purpose in a Linux system is to keep time when Linux is not running. You
341initialize the System Time to the time from the Hardware Clock when Linux
342starts up, and then never use the Hardware Clock again. Note that in DOS,
343for which ISA was designed, the Hardware Clock is the only real time clock.
344.PP
345It is important that the System Time not have any discontinuities such as
9abb2685 346would happen if you used the
7eda085c 347.BR date (1L)
fd6b7a7f
KZ
348program to set it while the system is running. You can, however, do whatever
349you want to the Hardware Clock while the system is running, and the next
350time Linux starts up, it will do so with the adjusted time from the Hardware
9abb2685 351Clock. You can also use the program
7eda085c 352.BR adjtimex (8)
fd6b7a7f 353to smoothly adjust the System Time while the system runs.
5c36a0eb
KZ
354.PP
355A Linux kernel maintains a concept of a local timezone for the system.
356But don't be misled -- almost nobody cares what timezone the kernel
357thinks it is in. Instead, programs that care about the timezone
358(perhaps because they want to display a local time for you) almost
359always use a more traditional method of determining the timezone: They
5213517f
KZ
360use the TZ environment variable and/or the
361.I /usr/share/zoneinfo
362directory, as explained in the man page for
363.BR tzset (3).
364However, some
5c36a0eb
KZ
365programs and fringe parts of the Linux kernel such as filesystems use
366the kernel timezone value. An example is the vfat filesystem. If the
367kernel timezone value is wrong, the vfat filesystem will report and
368set the wrong timestamps on files.
369.PP
66ee8158 370.B hwclock
5c36a0eb 371sets the kernel timezone to the value indicated by TZ and/or
5213517f 372.I /usr/share/zoneinfo
9abb2685 373when you set the System Time using the
5c36a0eb
KZ
374.B \-\-hctosys
375option.
376.PP
22853e4a
KZ
377The timezone value actually consists of two parts: 1) a field
378tz_minuteswest indicating how many minutes local time (not adjusted
379for DST) lags behind UTC, and 2) a field tz_dsttime indicating
380the type of Daylight Savings Time (DST) convention that is in effect
381in the locality at the present time.
382This second field is not used under Linux and is always zero.
383(See also
384.BR settimeofday (2).)
fd6b7a7f 385
2b6fc908
KZ
386.SH How hwclock Accesses the Hardware Clock
387.PP
9abb2685 388.B hwclock
2b6fc908
KZ
389Uses many different ways to get and set Hardware Clock values.
390The most normal way is to do I/O to the device special file /dev/rtc,
391which is presumed to be driven by the rtc device driver. However,
392this method is not always available. For one thing, the rtc driver is
393a relatively recent addition to Linux. Older systems don't have it.
7eda085c
KZ
394Also, though there are versions of the rtc driver that work on DEC
395Alphas, there appear to be plenty of Alphas on which the rtc driver
396does not work (a common symptom is hwclock hanging).
88681c5f
KZ
397Moreover, recent Linux systems have more generic support for RTCs,
398even systems that have more than one, so you might need to override
399the default by specifying
400.I /dev/rtc0
401or
402.I /dev/rtc1
403instead.
2b6fc908
KZ
404.PP
405On older systems, the method of accessing the Hardware Clock depends on
9abb2685 406the system hardware.
2b6fc908 407.PP
9abb2685
KZ
408On an ISA system,
409.B hwclock
7eda085c
KZ
410can directly access the "CMOS memory" registers that
411constitute the clock, by doing I/O to Ports 0x70 and 0x71. It does
412this with actual I/O instructions and consequently can only do it if
413running with superuser effective userid. (In the case of a Jensen
414Alpha, there is no way for
9abb2685 415.B hwclock
7eda085c
KZ
416to execute those I/O instructions, and so it uses instead the
417/dev/port device special file, which provides almost as low-level an
418interface to the I/O subsystem).
2b6fc908
KZ
419
420This is a really poor method of accessing the clock, for all the
421reasons that user space programs are generally not supposed to do
422direct I/O and disable interrupts. Hwclock provides it because it is
7eda085c
KZ
423the only method available on ISA and Alpha systems which don't have
424working rtc device drivers available.
2b6fc908
KZ
425
426.PP
427On an m68k system,
66ee8158 428.B hwclock
2b6fc908
KZ
429can access the clock via the console driver, via the device special
430file /dev/tty1.
431.PP
9abb2685 432.B hwclock
2b6fc908 433tries to use /dev/rtc. If it is compiled for a kernel that doesn't have
88681c5f
KZ
434that function or it is unable to open /dev/rtc
435(or the alternative special file you've defined on the command line)
9abb2685 436.B hwclock
7eda085c 437will fall back to another method, if available. On an ISA or Alpha
2b6fc908 438machine, you can force
66ee8158 439.B hwclock
2b6fc908 440to use the direct manipulation of the CMOS registers without even trying
7eda085c
KZ
441.I /dev/rtc
442by specifying the \-\-directisa option.
2b6fc908
KZ
443
444
fd6b7a7f
KZ
445.SH The Adjust Function
446.PP
447The Hardware Clock is usually not very accurate. However, much of its
7eda085c 448inaccuracy is completely predictable - it gains or loses the same amount
fd6b7a7f 449of time every day. This is called systematic drift.
9abb2685 450.BR hwclock 's
fd6b7a7f
KZ
451"adjust" function lets you make systematic corrections to correct the
452systematic drift.
453.PP
9abb2685
KZ
454It works like this:
455.B hwclock
fd6b7a7f
KZ
456keeps a file,
457.I /etc/adjtime,
458that keeps some historical information. This is called the adjtime file.
459.PP
9abb2685 460Suppose you start with no adjtime file. You issue a
7eda085c 461.I hwclock \-\-set
9abb2685
KZ
462command to set the Hardware Clock to the true current time.
463.B Hwclock
464creates the adjtime file and records in it the current time as the
fd6b7a7f 465last time the clock was calibrated.
66ee8158 4665 days later, the clock has gained 10 seconds, so you issue another
7eda085c 467.I hwclock \-\-set
9abb2685
KZ
468command to set it back 10 seconds.
469.B Hwclock
fd6b7a7f
KZ
470updates the adjtime file to show the current time as the last time the
471clock was calibrated, and records 2 seconds per day as the systematic
472drift rate. 24 hours go by, and then you issue a
7eda085c 473.I hwclock \-\-adjust
9abb2685
KZ
474command.
475.B Hwclock
fd6b7a7f
KZ
476consults the adjtime file and sees that the clock gains 2 seconds per
477day when left alone and that it has been left alone for exactly one
478day. So it subtracts 2 seconds from the Hardware Clock. It then
479records the current time as the last time the clock was adjusted.
480Another 24 hours goes by and you issue another
7eda085c 481.I hwclock \-\-adjust.
9abb2685 482.B Hwclock
fd6b7a7f
KZ
483does the same thing: subtracts 2 seconds and updates the adjtime file
484with the current time as the last time the clock was adjusted.
485.PP
9abb2685 486Every time you calibrate (set) the clock (using
7eda085c 487.I \-\-set
5c36a0eb 488or
7eda085c 489.I \-\-systohc
5c36a0eb 490),
9abb2685 491.B hwclock
fd6b7a7f
KZ
492recalculates the systematic drift rate based on how long it has been
493since the last calibration, how long it has been since the last
494adjustment, what drift rate was assumed in any intervening
495adjustments, and the amount by which the clock is presently off.
496.PP
9abb2685
KZ
497A small amount of error creeps in any time
498.B hwclock
fd6b7a7f
KZ
499sets the clock, so it refrains from making an adjustment that would be
500less than 1 second. Later on, when you request an adjustment again,
501the accumulated drift will be more than a second and
9abb2685 502.B hwclock
fd6b7a7f
KZ
503will do the adjustment then.
504.PP
9abb2685 505It is good to do a
7eda085c 506.I hwclock \-\-adjust
9abb2685 507just before the
7eda085c 508.I hwclock \-\-hctosys
fd6b7a7f
KZ
509at system startup time, and maybe periodically while the system is
510running via cron.
511.PP
7eda085c
KZ
512The adjtime file, while named for its historical purpose of controlling
513adjustments only, actually contains other information for use by hwclock
514in remembering information from one invocation to the next.
515.PP
5c36a0eb 516The format of the adjtime file is, in ASCII:
fd6b7a7f 517.PP
5c36a0eb
KZ
518Line 1: 3 numbers, separated by blanks: 1) systematic drift rate in
519seconds per day, floating point decimal; 2) Resulting number of
520seconds since 1969 UTC of most recent adjustment or calibration,
521decimal integer; 3) zero (for compatibility with
66ee8158 522.BR clock (8))
7eda085c 523as a decimal integer.
fd6b7a7f
KZ
524.PP
525Line 2: 1 number: Resulting number of seconds since 1969 UTC of most
7eda085c
KZ
526recent calibration. Zero if there has been no calibration yet or it
527is known that any previous calibration is moot (for example, because
9abb2685 528the Hardware Clock has been found, since that calibration, not to
7eda085c
KZ
529contain a valid time). This is a decimal integer.
530.PP
9abb2685 531Line 3: "UTC" or "LOCAL". Tells whether the Hardware Clock is set to
7eda085c 532Coordinated Universal Time or local time. You can always override this
9abb2685 533value with options on the
66ee8158 534.B hwclock
7eda085c 535command line.
fd6b7a7f 536.PP
9abb2685 537You can use an adjtime file that was previously used with the
66ee8158 538.BR clock (8)
9abb2685 539program with
66ee8158 540.B hwclock.
fd6b7a7f 541
5c36a0eb 542
7eda085c 543.SH "Automatic Hardware Clock Synchronization By the Kernel"
5c36a0eb 544
9abb2685 545You should be aware of another way that the Hardware Clock is kept
5c36a0eb 546synchronized in some systems. The Linux kernel has a mode wherein it
9abb2685 547copies the System Time to the Hardware Clock every 11 minutes.
5c36a0eb
KZ
548This is a good mode to use when you are using something sophisticated
549like ntp to keep your System Time synchronized. (ntp is a way to keep
550your System Time synchronized either to a time server somewhere on the
551network or to a radio clock hooked up to your system. See RFC 1305).
552
553This mode (we'll call it "11 minute mode") is off until something
554turns it on. The ntp daemon xntpd is one thing that turns it on. You
555can turn it off by running anything, including
7eda085c
KZ
556.IR "hwclock \-\-hctosys" ,
557that sets the System Time the old fashioned way.
5c36a0eb
KZ
558
559To see if it is on or
9abb2685 560off, use the command
7eda085c 561.I adjtimex \-\-print
5c36a0eb
KZ
562and look at the value of "status". If the "64" bit of this number
563(expressed in binary) equal to 0, 11 minute mode is on. Otherwise, it
564is off.
565
9abb2685 566If your system runs with 11 minute mode on, don't use
7eda085c 567.I hwclock \-\-adjust
5c36a0eb 568or
7eda085c 569.IR "hwclock \-\-hctosys" .
5c36a0eb 570You'll just make a mess. It is acceptable to use a
9abb2685 571.I hwclock \-\-hctosys
5c36a0eb
KZ
572at startup time to get a reasonable System Time until your system is
573able to set the System Time from the external source and start 11
574minute mode.
575
576
7eda085c
KZ
577.SH ISA Hardware Clock Century value
578
579There is some sort of standard that defines CMOS memory Byte 50 on an ISA
9abb2685 580machine as an indicator of what century it is.
66ee8158 581.B hwclock
7eda085c
KZ
582does not use or set that byte because there are some machines that
583don't define the byte that way, and it really isn't necessary anyway,
584since the year-of-century does a good job of implying which century it
585is.
586
9abb2685 587If you have a bona fide use for a CMOS century byte, contact the
66ee8158 588.B hwclock
7eda085c
KZ
589maintainer; an option may be appropriate.
590
591Note that this section is only relevant when you are using the "direct
592ISA" method of accessing the Hardware Clock.
88681c5f
KZ
593ACPI provides a standard way to access century values, when they
594are supported by the hardware.
7eda085c
KZ
595
596.SH "ENVIRONMENT VARIABLES"
5c36a0eb
KZ
597.I TZ
598
fd6b7a7f
KZ
599.SH FILES
600.I /etc/adjtime
a2c5f3ca
KZ
601.I /usr/share/zoneinfo/
602.RI ( /usr/lib/zoneinfo
603on old systems)
7eda085c 604.I /dev/rtc
88681c5f 605.I /dev/rtc0
7eda085c
KZ
606.I /dev/port
607.I /dev/tty1
608.I /proc/cpuinfo
609
610.SH "SEE ALSO"
611.BR adjtimex (8),
612.BR date (1),
613.BR gettimeofday (2),
614.BR settimeofday (2),
615.BR crontab (1),
616.BR tzset (3)
fd6b7a7f
KZ
617
618.SH AUTHORS
63cccae4 619Written by Bryan Henderson, September 1996 (bryanh@giraffe-data.com),
2b6fc908 620based on work done on the
fd6b7a7f 621.I clock
9abb2685 622program by Charles Hedrick, Rob Hooft, and Harald Koenig.
7eda085c
KZ
623See the source code for complete history and credits.
624
86d62711
KZ
625.SH AVAILABILITY
626The hwclock command is part of the util-linux-ng package and is available from
627ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.