1

The typical way to set the timezone is to use timedatectl, e.g.:

sudo timedatectl set-timezone America/New_York

So I can use a named zone, or UTC.

But how do I set the zone without a name - e.g. UTC-5 or UTC+10 or whatever?

lonix
  • 2,438

1 Answers1

1

Yes, quite inconvenient indeed.
This is kind of lame to suggest but you could list all available timezone names with timedatectl list-timezones and look for a region or city name that you know is located in the UTC timezone you are interested in. Sorry, I know that is not the answer you were looking for .....

yesno
  • 201
  • That is more or less what I did, but I don't want to hardcode the name as it needs to be dynamic. Are you implying that this is not possible with timedatectl and I need to fall back to one of those older TZ tools? – lonix Sep 02 '19 at 18:51
  • I don't know if it's not possible but man timedatectl gives no indication how it could be done. Have a look at man localtime(5) perhaps. There is mention of UTC (quote: .... identifier such as "Europe/Berlin" or "Etc/UTC" ...) That's just a hint, have not used it myself. – yesno Sep 02 '19 at 19:00
  • Maybe this is more helpful – yesno Sep 02 '19 at 19:07