File or API to simply get the server's default time zone?
What file is the server's time zone set in? Or if not that simple (buried among other settings in a consolidated file) is there an API I can call? I just realized that the server wasn't set to UTC and I've fixed that in WHM however I want to have that in my server status page when I verify that everything is as it should be.
-
/etc/localtime is a symlink to the timezone the server is using.
0 -
@quietFinn thanks however I don't see that file/alias. My host apparently is using a different Linux distribution so I'll inquire there.
0 -
You should be able to see it in WHM under Server Configuration, Server Time. You can change it from there also.
0 -
I need the file that I can access with my programming language to automate things.
0 -
From root CLI you can get the timezone via:
timedatectl
(that should work on either Alma or Ubuntu)
To set it it woudl be:
timedatectl set-timezone timezone
You'd need to be root on Alama and Sudo permissions on Ubuntu (or be root).
You should be able to query the servers timezone from just about any programming language.
0
Please sign in to leave a comment.
Comments
5 comments