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.

  • Yes all Unix machines should use UTC. The timezone is applied at display time. – ctrl-alt-delor Jul 17 '19 at 11:21
  • Are you asking “How do I show the time in another timezone?“ – ctrl-alt-delor Jul 17 '19 at 11:21
  • yes - I just want to display the time of a different time zone. – HappyCoder Jul 17 '19 at 11:24

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
| improve this answer | |
  • 1
    Crap, 22 seconds faster – Panki Jul 17 '19 at 11:17

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.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.