timezone changed but offset stays at zeroI want the date command to give me the correct localized timestamp, but it only gives me GMT/UTC time.
I've included a small script, date-test.sh, to
Latest comments view all › I was able to figure it out with some help from this page:
> date '+%H:%M:%S %z %Z'
12:04:54 +0000 UTC
> TZ="Asia/Tokyo" date '+%H:%M:%S %z %Z'
12:05:15 +0000 Asia
> TZ="/usr/share/zoneinfo/Japan" date '+%H:%M:%S %z %Z'
21:05:42 +0900 JST
To summarize, the value I was passing with using the TZ environment variable was the issue.