LinuxDevCenter.com
oreilly.comSafari Books Online.Conferences.
BooksAll ArticlesSafari BookshelfO'Reilly GearFree Newsletters

FAQS
 FAQs
Apache FAQ
Linux FAQ
XML FAQ

Log in to particpate





TECH JOBS


   Linux FAQ > 8. How To Do This or Find Out That...
Question:  8.10. How To Set the Time Zone.
Answer:

Change directory to /usr/lib/zoneinfo/. Get the time zone package if you don't have this directory. The source is available in ftp://metalab.unc.edu/pub/Linux/system/admin/time/.

Then make a symbolic link named localtime pointing to one of the files in this directory (or a subdirectory), and one called posixrules pointing to localtime. For example:

   $ ln -sf US/Mountain localtime
   $ ln -sf localtime posixrules


This change will take effect immediately—try date.

If the system uses Red Hat-style configuration files, the respective time zone info files are /usr/share/zoneinfo and /etc/localtime.

The manual pages for tzset or tzselect describe setting the time zone. Some programs recognize the "TZ" environment variable, but this is not POSIX-correct.

You should also make sure that your Linux kernel clock is set to the correct GMT time. Type date -u and check that the correct UTC time is displayed. ("The Computer Has the Wrong Time.")


This FAQ is from Linux Frequently Asked Questions with Answers, maintained by Robert Kiesling

Sponsored by:

Contact UsMedia KitPrivacy PolicyPress NewsJobs @ O'Reilly
Copyright © 2000-2006 O’Reilly Media, Inc. All Rights Reserved.
All trademarks and registered trademarks appearing on the O'Reilly Network are the property of their respective owners.
For problems or assistance with this site, email