tags:

views:

10

answers:

0

Is there a reliable way to find the UTC-offset of a given time zone in the shell? On my linux box, I can use TZ=[TIME ZONE] date +%z but I need to run this on HP-UX, and the %z option of date is not supported.

I have a data file which has a number of timestamps (in UTC), and for each of them a timezone is indicated, and I need to find the UTC-offset and add it to the timestamp.

Ideally I would use a shell command for this, but I can also call Perl if necessary (using core libraries only, no CPAN).