xref: /illumos-gate/usr/src/man/man8/rtc.8 (revision 7bb0eb348e1119aed76a61d633a9106b6b9912f1)
1.\"
2.\" This file and its contents are supplied under the terms of the
3.\" Common Development and Distribution License ("CDDL"), version 1.0.
4.\" You may only use this file in accordance with the terms of version
5.\" 1.0 of the CDDL.
6.\"
7.\" A full copy of the text of the CDDL should have accompanied this
8.\" source.  A copy of the CDDL is also available via the Internet at
9.\" http://www.illumos.org/license/CDDL.
10.\"
11.\"
12.\" Copyright 2018 Gary Mills
13.\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved.
14.\"
15.Dd January 31, 2018
16.Dt RTC 8
17.Os
18.Sh NAME
19.Nm rtc
20.Nd provide all real-time clock and UTC-lag management
21.Sh SYNOPSIS
22.Nm
23.Op Fl csuvw
24.Op Fl z Ar zone-name
25.Sh DESCRIPTION
26The Real Time Clock (RTC) is the hardware device on x86 computers that maintains
27the date and time.
28The RTC is battery-powered, so that it keeps running when the computer is shut
29down.
30It can be set from the BIOS and also from the operating system running on the
31computer.
32The RTC has no setting for the time zone or for Daylight Saving Time (DST).
33It relies on the operating system for these facilities and for automatic changes
34between standard time and DST.
35.Pp
36On x86 systems, the
37.Nm
38command reconciles the difference in the way that time is established between
39UNIX and Windows systems.
40The internal clock on UNIX systems utilizes Universal Coordinated Time (UTC)
41while Windows systems usually expect the RTC to run in local time, including DST
42changes.
43.Pp
44Without arguments,
45.Nm
46displays the currently configured time zone string for the RTC.
47The currently configured time zone string is based on what was last recorded by
48.Nm Fl z Ar zone-name .
49.Pp
50The
51.Nm
52command is not normally run from a shell prompt; it is generally invoked by the
53system.
54Commands such as
55.Xr date 1
56and
57.Xr rdate 8 ,
58which are used to set the time on a system, invoke
59.Nm Fl c
60to ensure that daylight savings time (DST) is corrected for properly.
61.Sh OPTIONS
62.Bl -tag -width Ds
63.It Fl c
64This option checks for DST and makes corrections to the RTC if necessary.
65It is normally run once a day by a
66.Xr cron 8
67job.
68.Pp
69If there is no RTC time zone or
70.Pa /etc/rtc_config
71file, this option will do nothing.
72.It Fl s
73This option specifies that the RTC runs in local standard time all year round.
74It is incompatible with Windows, but is convenient if only one operating system
75is to be run on the computer.
76The
77.Xr cron 8
78command is not necessary, and should not be run.
79.It Fl u
80This option specifies that the RTC runs in UTC time.
81As a side effect, it sets the time zone in
82.Pa /etc/rtc_config
83to UTC.
84Windows can operate in UTC time, but requires a registry change to do so.
85The
86.Xr cron 8
87command is not necessary.
88.It Fl v
89This option specifies that the RTC tracks local time, including DST changes.
90This is the default.
91It accomodates Windows with no changes.
92The
93.Xr cron 8
94command is necessary to change the RTC when DST is in effect.
95.It Fl w
96This option does nothing.
97It is present for compatibility with Solaris 11.
98.It Fl z Ar zone-name
99This option, which is normally run by the system at software installation time,
100is used to specify the time zone in which the RTC is to be maintained.
101It updates the configuration file
102.Pa /etc/rtc_config
103with the name of the specified zone and the current UTC lag for that zone.
104If there is an existing
105.Pa /etc/rtc_config
106file, this command will update it.
107If not, this command will create it.
108.El
109.Sh FILES
110.Bl -tag -width "/etc/rtc_config"
111.It Pa /etc/rtc_config
112The data file used to record the time zone and UTC lag.
113This file is completely managed by
114.Nm .
115At boot time, the kernel reads the UTC lag from this file, and uses it to set
116the system time.
117.El
118.Sh ARCHITECTURE
119.Sy x86
120.Sh SEE ALSO
121.Xr date 1 ,
122.Xr attributes 7 ,
123.Xr cron 8 ,
124.Xr rdate 8
125