Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Maybe, The system clock is always UTC. The default time that is displayed via the date command is whatever timezone is configured.
What default timezone PHP uses is defined in the php.ini file date.timezone configuration setting. If you can not modify the php.ini file you can set the time zone in your actual php script using the date_default_timezone_set function.
If you were converting times away from UTC and storing the "corrected" values, then yes you're in trouble. I remember explicitly telling you not to do that.
You might want to take a look at the timedatectl command. It's output may cast some light on the situation.
I think it's a systemd-related command, as I had not heard of it until this thread caught my interest, but the odds are pretty good that your shared host uses systemd.
Last edited by frankbell; 11-16-2021 at 08:53 PM.
Reason: clarity
I just wondered it there could be any negative consequences at all.
That is actually depends on the software you use. If those can handle it properly. (I don't mean perl, php, python or whatever tools themselves, but the code running ....)
Usually the default timezone in the php.ini file is left blank blank which defaults to the timezone of the server. Since that is what you want there isn't a problem.
From personal experience I always get a postgresql warning that I should specifically set the timezone and not leave it a default.
Typically, everyone sets their server hardware clocks to UTC. Then, they set the time-zone according to where the server is located. This gives them binary clock-values that are directly comparable anywhere in the world, while offering time displays that are correct for the location. It's very unusual that a Chinese server operator would set the hardware clock to local time.
I think I know what you were try to write but the hardware clock and system clock are technically independent of each other. The system clock is always UTC but would say that most set a server's timezone to UTC versus local time.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.