![]() ![]() Using GNU realpath because /etc/localtime is a symlink IIRC, this is something those Debian devs came up with a while ago that fell out of favour. This is a simple readable file, but doesn't seem to be available on as many distros anymore. This solution is optimal on systems utilizing older versions of Systemd. Improvement upon Raman's answer, but without the useless use of grep. If you get an error similar to timedatectl: invalid option - 'p' that means your Systemd isn't ready to rule the world. This is the preferred method for all those who believe Systemd shall rule the world. I can personally confirm that this works on ALL of my modern Linux hosts. The environment variable TZ (if set) specifies the timezone. However, some may return extra whitespace at the beginning and/or end - trim if required. ![]() All of the following solutions will give you an IANA compatible Olson timezone ID (e.g. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |