You are not logged in.

#1 2006-07-04 13:56:22

JoeC
Member
From: Columbus, Ohio
Registered: 2005-12-10
Posts: 25

setting the current time

How do I get the time to display correctly in Gnome?  I am using Gnome 2.14.2.  The time on the panel currently says 2:52 AM when it is actually 9:52 AM.  I changed the timezone in /etc/rc.conf to "New_York/Eastern" (it was Canada/Pacific) and that changed it but not to the correct time.  Now instead of being about 12 hours off it is only 7 hours off.

Thanks,

Joe

Offline

#2 2006-07-04 14:05:48

Namelis1
Member
From: Warm and fuzzy
Registered: 2006-06-14
Posts: 11

Re: setting the current time

Right, an intresting question, while i dont have an anwser, i realy want to ask: why does arch have to mess with time? Since unless i set my timezone to my correct one, arch will go ahead and screw up the time that is written in my bios (CMOS if u want it so smile ).
Obviously the time that is set in the bios is the local time of the country that the machine is in.

Offline

#3 2006-07-04 14:33:21

Borosai
Member
From: Sandy Appendix, U.S.A.
Registered: 2006-06-15
Posts: 227

Re: setting the current time

My BIOS is set to my local time, and I haven't had any problems with the time in my system. As long as you set the HARDWARECLOCK option in rc.conf to match your BIOS (localtime or UTC), it should be fine.

And if you do the above and it's still off, I guess you can run date and set it again (look at the man page for DATE for the correct format)

Offline

#4 2006-07-04 14:43:37

twiistedkaos
Member
Registered: 2006-05-20
Posts: 666

Re: setting the current time

Use this command:

date --set=10:39AM

Change the time to what ever your time is.

Offline

#5 2006-07-04 14:52:11

JoeC
Member
From: Columbus, Ohio
Registered: 2005-12-10
Posts: 25

Re: setting the current time

thanks for the quick responses guys.  Turns out the time set in my bios was wrong.  I changed that and now it is displayed properly.  I'll remember that date command for future reference

Thanks again
Joe

Offline

#6 2006-07-04 21:11:34

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: setting the current time

ok here's the deal >
localtime: The time represented from your BIOS hardware clock.
UTC: The time represented offset, according to your specified time zone, from Greenwich Meantime. When you specify your time zone in /usr/share/zoneinfo and UTC is enabled, your BIOS clock will be set to Greenwich Time but your system represent that time plus or minus your timezone offset. The time zone you specify isn't just for UTC, it also has the data to adjust your time for daylight savings at the correct time for your time zone.

So why UTC? International communication. If two computers communicate with timestamps that are in a "universal time", there will be no missing time lapses. Plus greenwich doesn't have daylight savings because its constant all year around, which also removes daylight savings time lapses from communications.

Also note your hardware clock's only purpose is to save the time when you exit your OS so that your OS can read it once it reboots and set the kernel time (system time). Your kernel time has virtually unlimited precision --much better than the hwclock. Tools such as openntp or ntp help synchronize your system clock back to what it should be by gradually adjusting out the time inconsistancies from the transfer of system time to hardware clock and hwclock back to system and/or hardware clock time keeping inconsistancies.

So in short, if you don't dual boot with another OS that uses only localtime such as dumbass windows, use UTC.

If you wan't to use UTC, set your system time with date as described in an earlier post, then do hwclock --utc --systohc. That will commit the proper offset to the hardware clock. Then next time you reboot in arch, rc.sysinit will call hwclock --utc --hctosys to restore it. If you skip this step and you specify UTC in rc.conf your time won't be correct because its still in localtime, assuming that was the previous configuration.

Offline

#7 2006-07-05 07:11:04

ScriptDevil
Member
From: In Front of My PC
Registered: 2006-04-06
Posts: 253

Re: setting the current time

better still do as root
# date MMDDhhmmCCYYss
MM=month
DD=date
hh=hour (24 hr clk)
mm=min
CC=century=20
YY=year=06
like date 070418452006 for date 4th july 6:45 pm 2006


Be yourself, because you are all that you can be

Offline

#8 2006-07-05 11:35:13

Pick2
Member
From: Illinois
Registered: 2006-05-16
Posts: 55

Re: setting the current time

I ssh into my Macs and Linux blades and use:

sudo date -s 09:52:00

Thats  Hours:Minutes:Seconds , as I use a 24 hour clock


Just Folded Space From Arrakis

Offline

#9 2006-07-12 06:20:31

bodhi.zazen
Member
Registered: 2006-07-09
Posts: 16

Re: setting the current time

Install ntp (pacman -S ntp)
  If you get an error re: /etc/ntp.conf it is OK to delete (or re-name) this file and install ntp.

As root, run these 2 commands:

ntpdate ntp.nasa.gov
hwclock -w

Should do the trick


If is not broken ... tweak it

Offline

#10 2006-07-12 08:29:43

vacant
Member
From: downstairs
Registered: 2004-11-05
Posts: 816

Re: setting the current time

bodhi.zazen wrote:

ntpdate ntp.nasa.gov
hwclock -w

from man ntpdate

"Disclaimer: The functionality of this program is now available in the ntpd program. See the -q command line option in the ntpd - Net-work Time Protocol (NTP) daemon page. After a suitable period of mourning, the ntpdate program is to be retired from  this  distribution"

So I switched to ntpd a while ago.

As the ntp package provides both ntpd and ntpdate in /etc/rc.d, you can put the program of your choice in rc.conf and have it start on boot.

Offline

Board footer

Powered by FluxBB