LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-24-2011, 01:11 PM   #1
veeruk101
Member
 
Registered: Mar 2005
Distribution: Ubuntu 12.04 LTS
Posts: 249

Rep: Reputation: 16
3 ways of setting the time, which is correct?


There's 3 ways I've come across to change the time on a system. Could someone explain how they relate to each other?

1) ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime

2) In /etc/sysconfig/clock, add ZONE="Europe/London" and UTC=true

3) On systems with a GUI, simply updating the time in the GUI clock

Are #2 and #1 even necessary when you have a GUI clock? And what about when you don't have a GUI clock such as on a server, is #2 even necessary? Because when I did #1, the time gets updated but when I 'cat /etc/sysconfig/clock' it shows a different (the original) time zone. So clearly it's not even getting used. And it doesn't get picked up off a reboot because I have rebooted.

Any clarification would help, just trying to understand all this better, thanks.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 10-24-2011, 11:17 PM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Stretch (Fluxbox WM)
Posts: 1,389
Blog Entries: 52

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
My assumption is that you are asking about changing the timezone rather than the time.

The /etc/localtime file contains the actual timezone data, so if you wish to change the timezone, you can use a copy or a symbolic link from one of the /usr/share/zoneinfo files.

However, most distros provide a tool to do the reconfiguration for you, eg redhat-config-date or system-config-date in RedHat/Fedora, and dpkg-reconfigure tzdata in Debian. These may also make other changes (for example, setting the timezone name in an appropriate place).

The /etc/sysconfig/clock controls whether the hardware clock is treated as being in UTC time or not. Historically this has always been UTC. However, some other operating systems could not handle a UTC hardware clock (such as pre-NT versions of Windows), so it was useful to change this behaviour. You wouldn't normally touch it.

If you have a GUI that is able to change the timezone, then you don't need to also do it from the terminal command line. It is up to you if you prefer to use a command line or a GUI. An advantage of using the terminal is that you will understand more about the guts of the system, a disadvantage is that you will need to figure out the details specific to your particular distro.
 
2 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
syslog time wrong - but date returns the correct time? falc410 Linux - Newbie 5 11-09-2013 04:54 AM
time on our RH linux FTP server is four hours ahead, but desktop time is correct?? dgr Linux - Newbie 10 10-09-2007 05:42 AM
correct DISPLAY setting mathfeel Linux - Software 2 05-26-2006 02:15 PM
Ways To Run Windows & Linux Same Time megadeth Linux - Software 1 03-13-2005 05:45 PM
setting the correct time & timezone from kde? Jelle Debian 8 07-03-2004 10:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration