Add Your City To Linux's List of Time Zones
Ever feel like you're Rodney Dangerfield? You live someplace and Linux shows you no respect, time-zone-wise that is. What I mean is that you live somewhere that's not one of the time-zones that comes predefined with Linux. If that sounds like you, then read on and get Linux to show you a little respect.
Let's say for instance that we want to add Seattle, WA (the birthplace of Linux Journal) to the list of time-zones that Linux knows about. First, look in the list of predefined time-zones for a city that's in the the same time-zone as the city you want to add, in this case Los Angeles. Then as root do the following:
$ cd /usr/share/zoneinfo
$ cp America/Los_Angeles America/Seattle
This will make the new "Seattle" time-zone use the same time-zone data as "Los Angeles" uses. Note: if /usr/share/zoneinfo doesn't exist try /usr/lib/zoneinfo.
Now edit the file /usr/share/zoneinfo/zone.tab and find the line for the time-zone that you copied, in this case "Los Angeles":
US +340308-1181434 America/Los_Angeles Pacific Time
Duplicate that line and change the old time-zone name to the new one:
US +473622-1221955 America/Seattle Pacific Time
The numbers are the latitude and longitude of the city in the form +/-DDMM+/-DDDMM or +/-DDMMSS+/-DDDMMSS (D=Degrees, M=Minutes, S=Seconds). You can find that information on the web, for example at infoplease.
Now, logout and log back in and you should see your new time-zone in the list of available time-zones. The screenshot below shows it added to the list of time-zones that are displayed when I hover the mouse over the KDE clock.
| Attachment | Size |
|---|---|
| timezone.jpg | 20.36 KB |
Mitch Frazier is an Associate Editor for Linux Journal.
Trending Topics
| You Need A Budget | Feb 10, 2012 |
| The Linux powered LAN Gaming House | Feb 08, 2012 |
| Creating a vDSO: the Colonel's Other Chicken | Feb 06, 2012 |
| Your CMS Is Not Your Web Site | Feb 01, 2012 |
| Casper, the Friendly (and Persistent) Ghost | Jan 31, 2012 |
| Razor-qt 0.4 - Qt based Desktop Environment | Jan 30, 2012 |
- Well spotted. I've corrected
58 min 52 sec ago - This is a great program. We
3 hours 59 min ago - No Air for Linux
5 hours 48 min ago - HEWLETT PACKARD created
5 hours 58 min ago - HEWLETT PACKARD created
6 hours 1 min ago - very helpful :)
6 hours 22 min ago - I'll give it a whirl
14 hours 56 min ago - TFPT, don't you mean TFTP!? I
23 hours 25 min ago - wunderbar!!
23 hours 44 min ago - Lubuntu on a USB key
1 day 13 hours ago





Comments
Lotus Running on Linux
Very useful topic. We are running Lotus Domino server on the Linux platform and it took oyr admin person a while to figure it out.
Very simple indeed....
Thank you for sharing, although I don't change time zones often, it's a good idea, if you want to further customize your system.
Colour Graphic Design
Not only in the US Central Time Zone
do you have a big blank. Almost all time zones show few selections. You have to pick the large city which you are sure is in the same time zone as you are because, for example, Detroit is not listed, nor any city in my home State of Indiana. In any case, if I selected Indiana, it has been recent enough that we changed back to using Daylight Savings Time that many databases still list the state as not using EDT.
Good, but I was hoping for more...
This is useful information, however I was hoping for more. Every time I install a new version of my favorite distro, I have to select a city that is in the same time zone as my own, but it is not my city. That means I would have to perform this tweak on each machine every time. I have installed Linux on 6 machines and now have a 7th one to do. I was hoping that this article would instruct me on how to submit my city so it would be available the next time I installed the latest distro. I guess I had this crazy idea that the Linux distro producers could actually share the time zone city package amongst themselves and my city would now be there after I had submitted it to a general location they could all pull their data from. Maybe someday we will get there.
I Feel Your Pain
You're right that would be nice.
Mitch Frazier is an Associate Editor for Linux Journal.
Gnome is lost
Unfortunately Gnome can't figure this all out. Parts of it think the timezone is Pacific and parts think it isn't there. Seems that somewhere in Gnome someone did some hard coding. Which is why I rarely use Gnome, it's too windowsy for my taste, some like, I don't
stupid
WTF Who cares as long as it shows the right time. The cities are shown only for reference - it makes to sense to list *every single city in the state/country/world*.
Instead of picking a city it makes more sense to pick a timezone, eg, US/Eastern, US/Central, etc.
Nice
I care. I'd like to personalize my system as much as I can. Then I show it to my friends and they envy me a bit :).
Do you know it's a best way to learn your system? This article is very useful and I can't say the same about your comment.
--
Miami Web Design
That was so simple!
Now only if there was an easy way for folks to submit thier TZ information to some central repository of TZ info that all distros could make use of! That'd be pretty sweet!
Am I the only who noticed . . .
That there is a huge gap in the standard Linux TZ base, almost the entire mid north America in the US is blank. I have to always choose Chicago even though Saint Louis would be a lost closer and more logical. I notice this on the installation of nearly every Linux distro I've tried.