Go to main content

man pages section 8: System Administration Commands

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

rtc(8)

Name

rtc - provide all real-time clock and UTC-lag management

Synopsis

/usr/sbin/rtc [-c] [-z zone-name [–w]]

Description

The real-time clock is a hardware based time counter. It is used by the operating system to calculate the current time after optionally applying a time zone and daylight savings time adjustment. Some operating systems use a convention of storing a time-zone adjusted value in the real-time clock. Oracle Solaris generally stores a Universal Coordinated Time (UTC) value in the real-time clock.

On x86 systems, the rtc command reconciles the difference in the real-time clock values between Oracle Solaris and other operating systems which utilize local time.

Without arguments, rtc displays the currently configured time zone string. The currently configured time zone string is based on what was last recorded by rtc –z zone-name.

The rtc command is not normally run from a shell prompt. It is generally invoked by the system. The commands such as date(1) and rdate(8), which are used to set the time on a system, invoke /usr/sbin/rtc –c to ensure that daylight savings time (DST) is corrected properly.

Options

–c

This option checks for DST and makes corrections if necessary. It is normally run once a day by a cron job.

If there is no RTC time zone or /etc/rtc_config file, this option will do nothing.

–z zone-name

This option, which is normally run by the system at software installation time, is used to specify the time zone in which the RTC is to be maintained. It updates the configuration file /etc/rtc_config with the name of the specified zone and the current UTC lag for that zone. If there is an existing rtc_config file, this command will update it. If not, this command will create it.

–w

Only valid with the –z option. If this option is given, it is assumed that the real-time clock has the proper time and warps the system's time. By default, the system time is assumed to be correct and the real-time clock is modified instead.

Files

/etc/rtc_config

The data file used to record the time zone and UTC lag. This file is completely managed by /usr/sbin/rtc, and it is read by the kernel.

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Architecture
x86
Availability
system/core-os

See Also

date(1), attributes(7), rdate(8)