Why we use city names when configuring system timezones
One of the things we generally wind up doing when setting up systems
is configuring their time zone (except for the people who leave
their servers in UTC). On most Unixes, you can find the available
time zone names underneath
/usr/share/zoneinfo, which has become
something of a cross-Unix standard. Once upon a time, it was normal
to set these to the name of a time zone, such as 'Eastern', and
even today some things will accept names like 'US/Eastern' or
'Canada/Pacific'. However, we normally no longer do that; instead
we try to set system time zones to the name of the city that the
server (or you) are in, such as 'America/Toronto'. The timezone
information then maps this city to the relevant time zone name
The reason for this indirection is that people have an inconvenient habit of changing the rules governing local time zones (either how they work or what time zone a particular place is in). For one example, some areas in North America have decided to not shift between daylight saving time and standard time, effectively putting themselves into a different time zone than they used to be. It's much easier to automatically apply a rule change that applies to you if you've told the system 'whatever the rules are for this city' than if you've just said 'we're in Eastern time'. If you've done the latter, it's going to be on you to change that to 'Eastern time without ...' or 'Canadian (not USA) Eastern time' or whatever other unusual trick of time zones people have come up with lately.
(This is perhaps more likely to be an issue in North America, where there are two countries and multiple states involved in this, creating plenty of room for many people with clever ideas.)
In fact, I'm not sure whether modern Unixes even really let you pick the generic timezone names any more or if they more or less force you to specify the timezone as a city. There are times when specifying the timezone by city is not necessarily ideal (for example, when you're not in one of the listed cities), but on the whole forcing you to be as specific as possible is a good idea.
(This entry was sparked by reading Time on Unix.)
PS: While some people advocate strongly for always setting servers to UTC, I feel that this is definitely not a one size fits all issue (for reasons outside the scope of this entry). Take it as a given that you've decided not to set your machine to UTC, so you need some way to specify a useful timezone for it.
Comments on this page:Written on 15 May 2020.