From 88a3372e88c4ccd2714c3d95ef4719140436214a Mon Sep 17 00:00:00 2001 From: Scott James Remnant Date: Wed, 4 Mar 2009 17:10:43 +0000 Subject: hwclock: add --systz option to set system clock from itself Since the system clock time is already set from the hardware clock by the kernel (when compiled with CONFIG_RTC_HCTOSYS), there's no particular need to read the hardware clock again. This option sets the system clock using itself as a reference if the hardware clock was in local time. The resulting system clock time is in UTC, with the kernel timezone set to the difference. [kzak@redhat.com: - fix the condition that controls read_adjtime() call] Signed-off-by: Scott James Remnant Signed-off-by: Karel Zak --- hwclock/hwclock.8 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'hwclock/hwclock.8') diff --git a/hwclock/hwclock.8 b/hwclock/hwclock.8 index 31eda21f3..7f0c53d94 100644 --- a/hwclock/hwclock.8 +++ b/hwclock/hwclock.8 @@ -54,6 +54,25 @@ This is a good option to use in one of the system startup scripts. .B \-w, \-\-systohc Set the Hardware Clock to the current System Time. .TP +.B \-\-systz +Reset the System Time based on the current timezone. + +Also set the kernel's timezone value to the local timezone +as indicated by the TZ environment variable and/or +.IR /usr/share/zoneinfo , +as +.BR tzset (3) +would interpret them. +The obsolete tz_dsttime field of the kernel's timezone value is set +to DST_NONE. (For details on what this field used to mean, see +.BR settimeofday (2).) + +This is an alternate option to +.B \-\-hctosys +that does not read the hardware clock, and may be used in system startup +scripts for recent 2.6 kernels where you know the System Time contains +the Hardware Clock time. +.TP .B \-\-adjust Add or subtract time from the Hardware Clock to account for systematic drift since the last time the clock was set or adjusted. See discussion -- cgit v1.2.3-55-g7522