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?


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 .....

  • 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 2 '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 2 '19 at 19:00
  • Maybe this is more helpful – yesno Sep 2 '19 at 19:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.