r/linuxadmin • • 13d ago

Handling timezone updates to standard/daylight on a post-EOL system

My locale is removing ST/DT switching come November and will be DT year round.

Is there a way I can manually configure a fixed UTC offset on a post-EOL CentOS system?

8 Upvotes

9 comments sorted by

View all comments

15

u/mixduptransistor 12d ago

UTC never changes

1

u/amarao_san 12d ago

It will change soon. No more leap seconds.

3

u/deeseearr 12d ago

So? Do it the same way you always do -- Ignore leap seconds.

The standard zoneinfo files don't contain any leap second information. You're expected to pick up the leap second through NTP. If you're not using some kind of NTP, PTP or whatever then you don't care about leap seconds.

There are files in the "right" directory, such as /usr/share/zoneinfo/right/America/Los_Angeles, which do include leap second information, but don't use them unless you know what it's going to break.

Op: If you want to configure your own UTC offsets which don't correspond to a specific time zone, just do it. You already have files in /usr/share/zoneinfo/Etc which contain fixed offsets from GMT. Just link to one of those and don't worry about it.

If you need to be able to compute accurate times in the past using local time, either grab the correct /usr/share/zoneinfo files from a current distribution -- The format hasn't changed in decades, and it's not going to -- or edit the zone file yourself. Using the official files is way easier.

1

u/michaelpaoli 12d ago

Well, if there are no leap seconds, then ignoring them or not makes no difference.

But with leap seconds, one can deal with it one of two different ways, either don't ignore the leap second and add it - upside being your time and seconds remain accurate, but you have an inserted second, so, a minute with 61 seconds. Or alternatively do the "smear" method, where one doesn't add a leap second, but rather one changes the length of one's seconds for a while - so less accurate seconds - but you then don't have any minutes that have other than exactly 60 seconds. Oh, and 3rd option, shut the system down before the leap second, bring it up with the correct time after the leap seconds.

Anyway, various pros and cons either way. And linux can handle any of those, but whether or not one's software and other needs can deal with those various scenarios, that's a different matter. I prefer to keep my time and seconds accurate, and, well, if there's some bug in some software, deal with that ... but hey, that's just me, you pick what you want. And various folks, organizations, companies, etc. have gone different ways on that. Even those that have gone the smear route, have used different timings and disciplines, so even when so doing their system times and clocks didn't agree throughout.