Change the Time Zone on a Linux VPS to IST
Changing the time zone on a Linux VPS makes local system time and many time-stamped logs display India Standard Time (IST), UTC+05:30. You need a shell session with administrator privileges; the steps below use systemd’s timedatectl and include alternatives for older or minimal systems.
What You’ll Need
- SSH access to the VPS, or access to its provider’s console.
- A user account with
sudoprivileges, or the root password. - The time zone database installed. Most mainstream Linux distributions include it; minimal images may not.
Step-by-Step
- Connect to the server. Sign in over SSH or open the VPS console. If using SSH, a typical command is
ssh username@server-address. Replace the example values with your login name and server address. - Check the current clock and time zone. Run
timedatectl. Look for the local time, universal time (UTC), and theTime zoneline. You can also rundateto see the current displayed date and time. These commands are read-only. - Confirm the exact time zone name. For India, the standard IANA time zone identifier is
Asia/Kolkata. Check that the system recognizes it by runningtimedatectl list-timezones | grep -x 'Asia/Kolkata'. The command should printAsia/Kolkata. This is preferable to entering a fixed offset because the named zone carries the relevant time-zone rules. - Set the system time zone. Run
sudo timedatectl set-timezone Asia/Kolkata. If you are already logged in as root, omitsudo. The command changes the system’s configured time zone; it does not manually change the underlying hardware clock or set the clock to an arbitrary time. - Verify the result. Run
timedatectlagain and confirmTime zone: Asia/Kolkata (IST, +0530)or equivalent. Then rundate. The displayed local time should be five hours and 30 minutes ahead of UTC. Check that the date is correct too, especially if the change crosses midnight. - Check any applications that depend on a time zone. Most system services read the host’s configured zone, but containers, applications, databases, and scheduled jobs can use their own time-zone settings. Review their configuration if their logs or schedules still appear to use UTC or another zone. Avoid restarting services unnecessarily; follow the application’s own instructions if a reload is required.
- Use a fallback if
timedatectlis unavailable. On many Linux systems, the active zone is represented by/etc/localtime. If the system has the zone file, a root user can set it withln -sf /usr/share/zoneinfo/Asia/Kolkata /etc/localtime, then verify withdate. This changes a system file, so use it only when the system’s documented method is unavailable. Some distributions manage this file differently.
Common Mistakes
- Using “IST” as the zone name. The abbreviation is ambiguous internationally. Use
Asia/Kolkatato specify Indian Standard Time clearly. - Setting a fixed UTC offset instead of a named zone. An offset such as
UTC+05:30may display the expected current time, but it does not identify the region’s time-zone rules. Prefer the IANA identifier. - Confusing time zone with system clock synchronization. Setting the zone changes how the time is displayed, not whether the clock is accurate. Network time synchronization is a separate setting, commonly handled by systemd-timesyncd, chrony, or another NTP service.
- Expecting every program to change instantly. Services or containers may have separate configurations or may need to be restarted to reread the setting. Check the relevant application before changing it.
- Assuming scheduled jobs are unaffected. Cron jobs and application schedules can interpret times using the system zone or a separately configured zone. Review time-sensitive jobs after making the change.
Tips
- Record the original time zone before changing it, so you can restore it if needed.
- Keep server logs and distributed services in UTC when consistency across regions matters. You can leave the server in UTC and configure a user interface or application to display IST instead.
- Use
timedatectl statusfor a concise status check, anddate -uwhen you specifically want to compare the UTC clock. - Changing the time zone normally does not require a reboot. The setting takes effect immediately for programs that consult the system configuration.
- For containers, check both the host and the container. A container may not inherit the host’s zone configuration, even if it uses the same kernel.
Troubleshooting
timedatectl: command not found or the system is not running systemd: Identify the distribution and use its documented time-zone configuration tool. On a system with the standard zoneinfo files, the /etc/localtime symlink method above may work. Do not install or replace system components blindly on a production VPS.
Asia/Kolkata is not listed or the zone file is missing: The time-zone database may be absent or incomplete. Install or update the distribution’s time-zone data package using its package manager and official repository, then retry. Package names and commands differ by distribution. If you cannot install packages, contact the VPS administrator or provider.
You get a permission error: Run the command with sudo if your account is authorized, or sign in as root. If the account lacks administrative access, ask the server administrator; changing a machine-wide time zone requires elevated privileges.
The displayed time is still wrong: First confirm timedatectl reports Asia/Kolkata. Then compare date with date -u; the difference should be 5 hours 30 minutes. If both values are wrong, check that network time synchronization is active and that the VPS clock is correct. Do not try to fix a clock drift by changing the time zone.
Only one service shows the old time: Check the service’s own time-zone setting, container configuration, runtime environment, or log display preferences. A service may use UTC by design. Restart or reload it only as appropriate for that software.
Frequently Asked Questions
What is the correct Linux time zone for India?
Use Asia/Kolkata. Its standard abbreviation is IST, and its offset is UTC+05:30.
Will changing the time zone change the actual time?
It changes the local representation of the system clock, not the clock’s underlying instant. The time shown locally will differ from UTC by the selected zone’s offset.
Do I need to reboot my VPS?
Usually not. The setting takes effect immediately for software that reads the system time zone, though a particular service may need a reload or restart.
Can I set IST without sudo?
Not normally for the whole server. A system-wide time-zone change requires administrator privileges. Some applications allow an individual user to select a display zone without changing the server.
Why do my logs still show UTC?
Many services deliberately write timestamps in UTC, or use their own configuration. Check the application’s logging settings; a UTC timestamp does not necessarily mean the host time zone was not changed.
How do I change the server back?
Run sudo timedatectl set-timezone Region/City with the original IANA zone identifier in place of Region/City. Confirm the setting with timedatectl.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.