You are not logged in.

#1 2003-07-23 04:48:05

Nacha
Member
Registered: 2003-07-23
Posts: 21

setup localtime [wiki]

Hi,
First of all, I am a newbie in linux and Archlinux. My first question for today is, How can I set up localtime. I edited /etc/rc.conf but still I have wrong time.
I do not remember the right command in order to setup the right time

# date cc/yy/dd/mm... it is correct?

This is a beautiful distro

Offline

#2 2003-07-23 09:10:03

andy
Member
From: Germany
Registered: 2002-10-11
Posts: 374

Re: setup localtime [wiki]

First : when you boot your machine and access the BIOS, what is the time there ? Is it the same time as on your watch ? If so, put

HARDWARECLOCK="localtime"

in your rc.conf. Otherwise put

HARDWARECLOCK="UTC"

there. Oh - and make sure the time there IS indeed correct. Either local, or UTC.

Then, browse /usr/share/zoneinfo/ and find the timezone you live in, or a city with the same timezone. Put the file relative to /usr/share/zoneinfo/ in rc.conf. Some examples could be

TIMEZONE=Europe/Berlin
TIMEZONE=Australia/Canberra
TIMEZONE=EST

Using a region/city scheme is preferred since then daylight savings times should be handled better.

Since you are a newbie, I would recommend you reboot now.

About using date : read

man date

so I don't have to repeat what's written there ;-) and note the -s flag.

Offline

#3 2003-07-23 22:55:54

Gyroplast
Member
From: Germany
Registered: 2002-09-03
Posts: 166
Website

Re: setup localtime [wiki]

A little info.

You have really two independent clocks running. A so called "system clock", which is the clock linux uses, and a BIOS clock, the "hardware clock" from which the system clock is set on bootup or explicit request. During the whole uptime of your system, your system clock runs independent of your BIOS clock, which is a good thing because these things are horribly inaccurate. wink

That being said, you can make a decision: Set your hardware clock to UTC or localtime? Simple: Some broken OS like Windows directly attach their system clock to the hardware clock, so you're stuck with setting your hardware clock to localtime, otherwise your OS won't show you the correct time. If you don't use Windows on the same machine, or you can live with the time difference between UTC and your localtime, using UTC in your hardware clock has a couple benefits; daylight savings time can be set automagically, leap years/seconds are correctly implemented, and you never really need to change your hardware clock, as UTC is as closed to standardized time as one can get.

So, you probably want UTC in your hardware clock. No big deal. There are two commands you should know. The date command shows and sets your system clock, and the hwclock command is your interface to the BIOS hardware clock. No need to reboot. You can display the absolute setting of your BIOS hwclock with the command "hwclock --show --localtime" (this is no typo, --localtime tells hwclock to not mangle the time with your locale setting). This should be the UTC time, aka. GMT or +0000.
If it isn't, you need to set your clock correctly. Probably easiest way to do that is using date in this way:

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

Where MM is the month, DD the day, hh and mm hours and minutes, and CCYY the four-digit year. Skip the .ss unless you _need_ seconds. You won't. Trust me. wink

So, to set the date and time to the 23rd of July 2003, 9pm, your line would look like this:

date 072321002003

Easy enough. Now your system clock should roughly equal your local time. If your timezone is set correctly in the rc.conf, you only need to save the system clock to the hardware clock with the command hwclock --utc --systohc, the timezone conversion back to UTC will be done automagically. That's it, really. All you need to make sure is that your timezone is set correctly, as andy described.

If you need to set localtime to your hwclock, do exactly the same but replace --utc with --localtime in the last hwclock command.

You might now consider installing the ntpd package and using ntpdate to keep your clock in sync with the rest of the world.

HTH,
  Dennis


"That's the problem with good advice. Nobody wants to hear it."
-- Dogbert

Offline

#4 2003-07-24 19:39:53

Nacha
Member
Registered: 2003-07-23
Posts: 21

Re: setup localtime [wiki]

@Andy and Gyroplast, Thanks very much for your answers.  i know that the next questions has to be a new topic, but I am to ask rght now. It is about to install packages from CD. Every time that I try to mount cd I receive a message that do not exist.

would you give me another wonderful explanation?

Thanks very, very much

Offline

#5 2003-07-24 22:39:50

beniro
Member
From: St. Petersburg, FL, USA
Registered: 2002-12-31
Posts: 313

Re: setup localtime [wiki]

If you have the default fstab configs and you're trying to mount /mnt/cd, you need to make the directory first:

mkdir /mnt/cd

then you can:

mount /mnt/cd


I hope this helps.  smile

Offline

#6 2003-08-04 00:03:52

jlvsimoes
Member
From: portugal
Registered: 2002-12-23
Posts: 392
Website

Re: setup localtime [wiki]

tzselect


-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GU/ d- s: a- C L U P+ L+++ E--- W+
N 0+ K- W-- !O !M V-- PS+ PE- V++ PGP T 5 Z+ R* TV+ B+
DI-- D- G-- e-- h! r++ z+ z*
------END GEEK CODE BLOCK------

Offline

Board footer

Powered by FluxBB