Page cover

๐Ÿ“…How to change the date and time

Here are some steps you can take to modify the date and time settings in Linux, both for the system and PHP.

Requirements

  • a VPS

  • an OnetSolutions account

๐Ÿ”—How to connect to Linux server

Instructions

To modify the date or time of your VPS, follow these steps and enter the respective commands:

dpkg-reconfigure 
tzdata 
tzconfig 
tzselect

To synchronize the time with an NTP server, you can follow these steps:

Debian / Ubuntu

apt-get update
apt-get install ntp ntpdate -y
ntpdate

PHP

To locate the PHP configuration file, you can follow these steps:

find /etc/ -name php.ini -type f

then modify it by adding the following line:

date.timezone = "Europe/Paris"

Last updated

Was this helpful?