You are not logged in.
Pages: 1
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
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
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.
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.
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
@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
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.
Offline
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
Pages: 1