How to Change the Timezone Settings on Your VPS

Step 1: Log in to Your VPS

  • Open your SSH client (e.g., PuTTY, Terminal) and log in to your VPS using your root credentials.

Step 2: Check the Current Timezone

  • Run the following command to view the current timezone setting:
    • timedatectl
  • The output will show the current time, timezone, and whether the system clock is synchronized.

Step 3: List Available Timezones

  • To view a list of available timezones, run the command:
    • timedatectl list-timezones
  • This will display all the supported timezones. You can scroll through or use grep to find a specific timezone.

Step 4: Set the Desired Timezone

  • Once you have identified the correct timezone, set it using the following command:
    • timedatectl set-timezone <Your/Timezone>
    • Replace <Your/Timezone> with the desired timezone, for example: timedatectl set-timezone Europe/London.

Step 5: Verify the Timezone Change

  • After setting the new timezone, verify the change by running:
    • timedatectl
  • This will confirm the system's new time and timezone settings.

Step 6: Synchronize the System Clock (Optional)

  • To ensure your system clock is correctly synchronized with the new timezone, use:
    • timedatectl set-ntp true
  • This ensures that Network Time Protocol (NTP) synchronization is enabled and keeps your system time accurate.

Step 7: Restart the VPS (if necessary)

  • If you notice any discrepancies or issues with the time, restart the VPS to apply all changes properly:
    • reboot

Note: Changing the timezone may affect the timestamps of logs and scheduled tasks on your VPS. Ensure that all services are tested after the change to avoid any potential issues.

 

Was this answer helpful? 0 Users Found This Useful (0 Votes)