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
You can use offset value in
TZ
to get the date for a different timezone:You could use
or if you want to do date arithmetic you could use
If the other solutioons don't work, use