This is a roundabout way to do this, but it works ( freely based on this ):
#!/bin/bash ZONE=$1 TIME=$(date +%s --utc -d "12:00:00 $ZONE") UTC_TIME=$(date +%s --utc -d "12:00:00") ((DIFF=UTC_TIME-TIME)) echo - | awk -v SECS=$DIFF '{printf "%d",SECS/(60*60)}'
Save this as tzoffset , make it executable and run it like this:
tzoffset PST
This script in its current form handles only reduced time intervals.
Trey hunner
source share