Issue
I would want to get the date and time from another time zone (UTC-4) with a bash command, but I don't want to configure it as the default TZ for the system.
Is there a simple way to do it?
E.g 1 (current):
$ date
fri nov 7 13:15:35 UTC 2014
E.g 2 (what I need):
$ date (+ some option for UTC-4)
fri nov 7 09:15:35 UTC 2014
Solution
You could use
TZ=America/New_York date
or if you want to do date arithmetic you could use
date -d "+5 hours"
Answered By - SMA Answer Checked By - Senaida (WPSolving Volunteer)