Skip to main content

File or API to simply get the server's default time zone?

Comments

5 comments

  • quietFinn

    /etc/localtime is a symlink to the timezone the server is using.

     

    0
  • JAB Creations

    @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
  • ffeingol

    You should be able to see it in WHM under Server Configuration, Server Time.  You can change it from there also.

    0
  • JAB Creations

    I need the file that I can access with my programming language to automate things.

    0
  • ffeingol

    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.