I mean, when I type location it gets GMT +/- fixes, were does that information come from?
1 Answer
Linux (and UNIX in general) systems usually keep the hardware clock in UTC.
Then, there is a system-wide time zone setting usually implemented as /etc/localtime
, copied from or linked to some file in /usr/share/zoneinfo
, which provides information on how to convert the UTC time value to a local date and time. This provides a default for all users' processes. Some distributions make /etc/localtime a symbolic link, and some (presumably for resilience in case /usr/share is unavailable) make an outright copy.
Then, a (user or system) process can set the TZ
environment variable to override this default. Such a setting will be inherited according to the normal environment-inheritance rules, which can be exploited to set the default time zone for a specific user separately from the system default. For multi-user systems with users spread out across time zones, this is a very useful property since each user will see the time he/she expects.
So, there isn't really a single place in which to look for the information you want.