Data Codes through Eyeglasses

Set the Correct Time Zone on Your Linux Server

How to Set Time Zone

Ensure your server operates on the appropriate time zone for its location. This guide walks you through checking the current time zone, exploring available options, and setting the desired zone using the timedatectl command.

Prerequisites:

  • SSH access to your Linux server/VPS.
  • To Get Access via SSH
Syntax:- ssh -p PORT USERNAME@HOSTIP
Example:- ssh -p 21350 u27653@216.32.44.12
  • Check Current System Time Zone
timedatectl
  • Check All TimeZone
timedatectl list-timezones
  • Filter TimeZone by City
Syntax:- timedatectl list-timezones | grep City_Name
Example:- timedatectl list-timezones | grep Kolkata
  • Set TimeZone
Syntax:- timedatectl set-timezone [timezone]
Example:- timedatectl set-timezone Asia/Kolkata