Getting numeric timezone on HP-UX

Hi

I thought the UNIX command date is universal and so I have been using

date +%z to get the numberic timezone offset (e.g. -0500)

however on HP-UX, this is not returning expected results; on my machine it returns the name of the time zone (e.g. EST) not numbers.

does anyone know how to get the number timezone offset on HP-UX?

thanks for your help

Is the TZ variable defined? That overrides the default file settings for timezones.

Check

/etc/timezone

it should be the setting for the current system timezone.

In HPUX the

/usr/lib/tztab

file has all of the settings for timezones. Check man tztab to learn how to set those to have offsets. I have not done HP-UX for loong time.

thanks but my script will be running across various HPUX systems, I don't think I have the ability to set the timezone per each system.

is there no universal numeric timezone offset in HPUX?