[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: Time



Stephen,

	This comes up quite often so let me help.	First there are two
clocks; system clock and hardware clock.

	The one we tend to know about is the system clock and we invoke the
date & time with the command;  	date

	The one we tend to not know about is the hardware clock.  To see the
hardware clock time use any one of the following:

	hwclock
	hwclock -r
	hwclock --show

	If you are in a Red Hat Linux environment in addition to the above
the commands;
	
	clock		will also work - (it does not work in Debian Linux.)

	So first set your system clock to get it exactly like you want it,
the syntax is;

	MMDDhhmm[[CC][YY].[ss]]

	MM = the month	03 for March
	DD = the day of the month	today 28
	hh = the hour of the day right now about 06
	mm = the minute of the hour right now about 29
	CC = is optional, the century 20
	YY = is the year, now 01
	.  = is the separator between YY and the seconds
	ss = is the seconds of the minute
	
	The things in [] are all optional

	Now to force the hardware clock time to be the system clock time do
either:

	hwclock -w

		OR

	hwclock --systohc

 	Should you want to force the system clock to be that of the hardware
clock do either:

	hwclock -s

		OR

	hwclock --hctosys

	You can also set the hardware clock directly with the following
syntax;

	hwclock --set --date="03/28/01 06:29:00"

	I recently became a Linux Professional Institute Certified
(LPIC)Systems Engineer and this is the kind of information they want you to
know about to pass the exams - hard work but very enjoyable.

	Join the discussion group;	lpi-discuss@lpi.org	as that is a
fine group to be associated with.	A couple of key players and class
act people are Dan York and Chuck Mead.
Also consider the LPI program as I think it is going to become the leader in
Linux certification.


Regards,

John D. Holp



-----Original Message-----
From: Matthew Dalton [mailto:matthewd@research.canon.com.au]
Sent: Tuesday, March 27, 2001 10:25 PM
To: stephen
Cc: Debian-user@lists.debian.org
Subject: Re: Time


stephen wrote:
> 
> I'm having a heck of a time getting my system time set correctly.
> /etc/localtime is a symlink to the proper time zone.  I've looked in
> /etc/default/rcS and switched UTC from yes to no and back again.
> And, I've read the man page for hwclock a few times.  Still,
> my system time is always six hours off.  (For example, it's
> 8:22pm right now, but my computer thinks it's 2:20pm.)
> 
> Anybody have any pointers on this?

You're in Central USA, aren't you? :)
... which means your timezone is GMT -6 hours!

This is no coincidence. When you installed you probably told it to set
your clock to GMT/UTC. When you do this, the hardware clock is set to
GMT and linux adds/subtracts the amount of time specified in your time
zone file for use as the system clock. That's why your clock is 6 hours
behind.

You can either:
1. leave UTC set to yes, set your clock to GMT/UTC
2. set UTC to no and set your clock to localtime

Option 1 is the best option if your system doesn't dual boot with
Windows. Otherwise use option 2.

Matthew


-- 
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact
listmaster@lists.debian.org



Reply to: