


CLOCK(8)	    Linux Programmer's Manual		CLOCK(8)


NNAAMMEE
       clock - manipulate the CMOS clock

SSYYNNOOPPSSIISS
       cclloocckk [[ --uu ]] --rr
       cclloocckk [[ --uu ]] --ww
       cclloocckk [[ --uu ]] --ss
       cclloocckk [[ --uu ]] --aa

DDEESSCCRRIIPPTTIIOONN
       cclloocckk  manipulates the CMOS clock in variaous ways, allow-
       ing it to be read or written, and allowing synchronization
       between	the  CMOS  clock  and the kernel's version of the
       system time.

OOPPTTIIOONNSS
       --uu     Indicates that the CMOS clock is set  to	Universal
	      Time.

       --rr     Read CMOS clock and print the result to stdout.

       --ww     Write the system time into the CMOS clock.

       --ss     Set the system time from the CMOS clock.

       --aa     Set  the system time from the CMOS clock, adjusting
	      the time to correct for systematic error, and writ-
	      ting it back into the CMOS clock.

	      This option uses the file _/_e_t_c_/_a_d_j_t_i_m_e to determine
	      how the clock changes.  It contains three numbers:
	      The first number is the correction in  seconds  per
	      day (for example, if your clock runs 5 seconds fast
	      each day, the first number should read -5.0).

	      The second number tells when cclloocckk was  last  used,
	      in seconds since 1/1/1970.

	      The  third number is the remaining part of a second
	      that was left over after the last adjustment.

	      The following  instructions  are	from  the  source
	      code:

	      a)     create a file _/_e_t_c_/_a_d_j_t_i_m_e containing as the
		     first and only line: '0.0 0 0.0'

	      b)     run _c_l_o_c_k _-_a_u  or	_c_l_o_c_k  _-_a,  depending  on
		     whether  your  CMOS is in Universal or Local
		     Time.  This updates the second number.

	      c)     set your system time using the _d_a_t_e command.

	      d)     update  your  CMOS	time  using _c_l_o_c_k _-_w_u or



Linux 0.99		24 December 1992			1





CLOCK(8)	    Linux Programmer's Manual		CLOCK(8)


		     _c_l_o_c_k _-_w

	      e)     replace the first number in _/_e_t_c_/_a_d_j_t_i_m_e  by
		     your correction.

	      f)     put  the  command	_c_l_o_c_k  _-_a_u or _c_l_o_c_k _-_a in
		     your _/_e_t_c_/_r_c_._l_o_c_a_l, or let ccrroonn(8) start  it
		     regularly.

FFIILLEESS
       _/_e_t_c_/_a_d_j_t_i_m_e
       _/_e_t_c_/_r_c_._l_o_c_a_l

BBUUGGSS
       This  is	from the source code: I did have a few occasions
       during testing where every number read from the	CMOS  was
       165  (BCD=0xff).	In that case mktime fails, and all kinds
       of weird things happen.	I  put	in  some  trapping  code,
       although I know that this shouldn't (can't?) happen.

AAUUTTHHOORRSS
       V1.0:  Charles  Hedrick,	hedrick@cs.rutgers.edu, Apr 1992
       V1.1:  Modified	for   clock   adjustments,   Rob   Hooft,
       hooft@chem.ruu.nl, Nov 1992

































Linux 0.99		24 December 1992			2


