Jumat, 07 Januari 2022

Setting the time zone WIB, WITA, WIT on PHP, MySQL and Linux systems

 First we will set the time zone for the West Indonesia Region (WIB) then Central Indonesia Time (WITA) and East Indonesia Time (WIT).

With the root account follow and run the following command line:

1. Preparation

Reset current timezone settings

unlink /etc/localtime

2. Linux system time zone settings

This will set the date and time for the Linux system

For WIB

ln -s /usr/share/zoneinfo/Asia/Jakarta /etc/localtime

For WITA

ln -s /usr/share/zoneinfo/Asia/Ujung_Pandang /etc/localtime

For WIT

ln -s /usr/share/zoneinfo/Asia/Jayapura /etc/localtime

3. Setting the time zone for PHP

For the date and time in PHP we need to set it too because it usually doesn't follow the system.

Edit the PHP configuration file or php.inifind the line ; date.timezone = edit and set timezone

For WIB

date.timezone = 'Asia/Jakarta'

For WITA

date.timezone = 'Asia/Ujung_Pandang'

For WIT

date.timezone = 'Asia/Jayapura'

4. Setting the time zone for the MySQL/MariaDB database

Likewise for MySQL databases, the time and date need to be determined so that create, update and delete are accurate with the application system used.

Edit the MySQL/MariaDB configuration file, in the column [mysqld]add the following lines and specify the timezone

For WIB

default-time-zone = "+07:00"

For WITA

default-time-zone = "+08:00"

For WIT

default-time-zone = "+09:00"

5. Reboot (optional)

To make sure everything runs smoothly and the timezone is as specified, please reboot the machine. Or restart each service: Apache , Nginx , PHP and MySQL/MariaDB databases .

Done, hopefully useful.

Tags :

bm

Redaksi

Seo Construction

I like to make cool and creative designs. My design stash is always full of refreshing ideas. Feel free to take a look around my Vcard.

  • Redaksi
  • Februari 24, 1989
  • 1220 Manado Trans Sulawesi
  • contact@example.com
  • +123 456 789 111

Posting Komentar