-1

My server runs on UCT time.

What is the command to check a specific time zone? i.e. America/New_York

And to be clear, I don't wish to update the servers time zone, I just want to know what it calculates another time zone to be.

3
  • Yes all Unix machines should use UTC. The timezone is applied at display time. Commented Jul 17, 2019 at 11:21
  • Are you asking “How do I show the time in another timezone?“ Commented Jul 17, 2019 at 11:21
  • yes - I just want to display the time of a different time zone. Commented Jul 17, 2019 at 11:24

2 Answers 2

1

The easiest way is to specify the time zone in the environment when running the date command:

$ TZ=America/New_York date
Wed Jul 17 07:16:39 EDT 2019
1
  • 1
    Crap, 22 seconds faster Commented Jul 17, 2019 at 11:17
1

From man date:

Show the time on the west coast of the US (use tzselect(1) to find TZ)

$ TZ='America/Los_Angeles' date

This works by setting the variable TZ to a new value just for the date command.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.