• 4 years

    4 years

    YetiShare / Core


Sync Date/Time Across PHP, MySQL & Linux

For Linux:

  • Open the /etc/sysconfig/clock file with your favorite text editor (such as vim or nano). ...
  • Locate the ZONE entry, and change it to the time zone file. List of timezones: i.e:
    • ZONE="Europe/Amsterdam"
  • Save the file and exit the text editor.

For PHP:

  • Open your php.ini file for editing. Possibly in /etc/php.ini.
  • Locate date.timezone = and add your timezone as above. i.e.
    • date.timezone = "Europe/Amsterdam"
  • Save and restart PHP / your web server.

For MySQL:

  • Open your my.cnf file for editing. Possibly in /etc/my.cnf.
  • After the [mysqld] section add:
    • default-time-zone = '+02:00'
  • Adjust the +02 depending on your preferred timezone.
  • Save and restart MySQL.