I am doing some timezone calculations in
bash. I'm getting some unexpected values when converting the timezone offset hour output to an integer to do some additional calculations.
offset=$(date +%z) echo "$offset" hours=$(( offset )) echo "$hours"
Desired Output (I accidentally omitted the need to divide by 100 for the final output)
I think that the arithmetic is getting evaluated as octal. How can I evaluate the output from
date +%z as decimal?