Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I want to configure linux box to use CST w/o daylight. My first idea was using the UTC-06 zone file, but for some weird reason it provides UTC+6, not UTC-6 time!

After that I read the List of tz database timezones article on Wikipedia, and copied the America/Costa_Rica zonefile to /etc/localtime. Now the timezone seems OK, but what if sometime Costa Rika goverment will decide to to to daylight?

What is the correct way to set UTC-6 for Linux?

share|improve this question

migrated from serverfault.com Nov 13 '11 at 14:24

This question came from our site for professional system and network administrators.

4 Answers 4

From the Wikipedia article on the tz database:

The special area of Etc is used for some administrative zones, particularly for "Etc/UTC" which represents Coordinated Universal Time. In order to conform with the POSIX style, those zone names beginning with "Etc/GMT" have their sign reversed from what most people expect. In this style, zones west of GMT have a positive sign and those east have a negative sign in their name (e.g "Etc/GMT-14" is 14 hours ahead/east of GMT.)

So if you're looking for a fixed UTC-6 timezone with no daylight savings at all, you should could use Etc/GMT+6

# zdump /usr/share/zoneinfo/Etc/GMT+6 /usr/share/zoneinfo/America/Costa_Rica
/usr/share/zoneinfo/Etc/GMT+6           Sun Nov 13 09:23:52 2011 GMT+6
/usr/share/zoneinfo/America/Costa_Rica  Sun Nov 13 09:23:52 2011 CST

That's really confusing, but hey, it works. So:

ln -sf /usr/share/zoneinfo/Etc/GMT+6 /etc/localtime

should do the trick.

You should not copy zoneinfo files to your /etc/localtime, but use a symlink. That way, if the zoneinfo database is updated, your system will see the change. (Unimportant in this case though.)

share|improve this answer

You're so certain that you'll never want to use daylight time? What happens if the government of the place you live decides to use it? What purpose is keeping your computer an hour out of sync with the real world?

Anyway, set TZ=CST6 - this isn't a timezone that exists in zoneinfo, it's the older environment variable standard. If you want an actual zoneinfo file [that you can use for localtime], compile (using zic) a source file consisting of the single line:

Zone    Etc/CST6         -6:00  -   CST

And use TZ=Etc/CST6 and link/copy the resulting file into /etc/localtime.

This has the advantage of using the proper abbreviation rather than a nonsense "GMT+06"

share|improve this answer

ln -sf /usr/share/zoneinfo/America/Costa_Rica /etc/localtime

Timezone updates are included along with your Linux distribution's updates, so you're safe in using the Costa_Rica specific zone file.

share|improve this answer
    
I believe the asker wants a timezone that is guaranteed not to have DST, not something that follows Costa Rica's zone (if it ever decided to implement DST again - it has in the past) –  Mat Nov 13 '11 at 15:25

Try Regina Saskatechewan. That time zone does not have Daylight Savings Time.

EDIT: While municipalities in the province follow the timezone of the boarding province, the province has never followed Daylight Saving Time. As they are really located in the Mountain timezone, they effectively enjoy permanent Daylight Saving Time. While they might switch to Mountain time and start using DST rules, there is no political will to do so. Whatever, timezone you pick would have the a risk of rules changing in the future. Just look at the timezones for some states, which go to three levels to handle peculiar timezone splits within the state.

share|improve this answer
    
It doesn't have DST now, but it has had in the past. Who knows if it won't have transitions again in the future? –  Mat Nov 13 '11 at 15:26
    
See my edit, and look at the Wikipedia article on the timezone. Regina is significantly far from the border with Manitoba. –  BillThor Nov 13 '11 at 15:54
    
"Whatever, timezone you pick would have the a risk of rules changing in the future." Not really. The UTC/GMT+xx zones don't and will not change. –  Mat Nov 13 '11 at 15:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.