Your service shows times in the time zone of the server. If you live in another one, the times you see over SSH, for example from date or ls -l, are shifted by some hours. You can set your own time zone for your SSH sessions.

The setting changes how times are shown to you after you log in. The clock of the server, your apps and your scheduled commands keep the time of the server; the last section explains what that means.


What You Need

1. Find the Name of Your Time Zone

Time zones have names made of a region and a large city, such as Europe/Warsaw or America/New_York. Search the list for a large city in your zone:

timedatectl list-timezones | grep -i warsaw
Europe/Warsaw

No result? Show all names of your region and pick the nearest large city:

timedatectl list-timezones | grep Europe

2. Try It for One Command

Put the name before a command to use it once. Nothing is changed yet:

TZ="Europe/Warsaw" date
Wed Dec  2 01:57:09 AM CET 2026

Compare it with date alone, which shows the time of the server.

3. Make It Permanent

Add one line to the file .profile in your home folder. Use your own time zone name:

echo 'export TZ="Europe/Warsaw"' >> ~/.profile

Log out and log in again. From now on every SSH session uses your time zone.

4. Check It

date
Wed Dec  2 01:57:09 AM CET 2026

The short name near the end, here CET, is your time zone. ls -l and other commands now show your time too.

Go Back to the Time of the Server

Open the file with nano ~/.profile, delete the line that starts with export TZ=, save with Ctrl+O and Enter, close with Ctrl+X and log in again.

What the Setting Does Not Change

  • Your apps keep the time of the server, also after a restart. Times in their logs and schedules do not move.
  • Scheduled commands (cron) start by the clock of the server. Convert your times before you write a schedule: Run a Command on a Schedule With cron on App Hosting.
  • Commands sent without logging in, for example ssh user@server date from a script on your computer, show the time of the server.

To see the time of the server while your own time zone is set, run:

env -u TZ date

Good to Know

  • What time is it elsewhere? The form from step 2 works with every name from the list, for example TZ="America/New_York" date.
  • Summer time is handled by the name of the zone: with a city name such as Europe/Warsaw the time changes by itself in spring and autumn.
Was this answer helpful? 144 Users Found This Useful (282 Votes)