How to Change Timezone to Asia or Jakarta on CentOS 7

   

Setting the correct timezone on your CentOS 7 system is crucial for ensuring that your system displays the accurate local time. In this tutorial, we'll guide you through the step-by-step process of changing the timezone to Asia/Jakarta, which is the timezone for Indonesia's capital city.

Prerequisites: Before you begin, make sure you have:

- Access to a CentOS 7 system with administrative privileges.

- Basic knowledge of working with the command line interface.

Steps to Change Timezone to Asia/Jakarta:

1. Check Current Timezone: Before making any changes, it's essential to verify the current timezone settings. Open your terminal and execute the following command :

date

This command will display the current date and time along with the timezone abbreviation.

2. Backup Existing Timezone Configuration: It's always recommended to create a backup of the current timezone configuration before making any modifications. Run the following command to back up the existing configuration file :

sudo cp /etc/localtime /etc/localtime.bak

3. List Available Timezones: To view the list of available timezones and find the one corresponding to Asia/Jakarta, use the following command :

timedatectl list-timezones | grep Jakarta

4. Set the New Timezone : Once you've identified the correct timezone (e.g., Asia/Jakarta), set it using the timedatectl command. Replace "Asia/Jakarta" with your desired timezone :

sudo timedatectl set-timezone Asia/Jakarta

5. Verify Changes : To confirm that the timezone has been successfully updated, execute the date command again :

date

The output should now display the current date and time in the Asia/Jakarta timezone.

Conclusion: By following the steps outlined in this tutorial, you have successfully changed the timezone on your CentOS 7 system to Asia/Jakarta. Ensuring that your system's timezone is accurate is essential for various tasks, including scheduling, logging, and system coordination. If you encounter any issues or have questions, feel free to refer back to this guide or seek further assistance.