问题
I'm trying to change my Jelastic server environment clock to UTC.
I tried:
hwclock --systohc
But my server (CentOS) somehow does not recognize the command hwclock
. Perhaps they removed it, I don't know. I tried searching their docs but did not find how to change the server clock.
Any ideas?
回答1:
In general you are expected to manipulate the timezone at application level, not server level (e.g. set the timezone to your needs in php.ini).
If you need the timezone to be changed at server level (e.g. to make cron more understandable), you can contact your hosting provider's support team for this.
The clock itself should already be correctly synchronised with NTP at platform level, so this should only ever be about switching between timezones...
回答2:
This command should work for VPS and Docker containers by default
ln -sf /usr/share/zoneinfo/Europe/Gibraltar /etc/localtime
For other container templates ask your cloud hosting provider to give you root access.
来源:https://stackoverflow.com/questions/29079052/jelastic-how-to-change-server-date-and-time-to-utc