Help - Timezone conversion problem

Bill Eldridge bill at hk.rfa.org
Thu Sep 30 07:08:39 EDT 1999


I had a Python script running on a Washington
machine to convert Eastern time to Hong Kong
time.  No problem - convert local Eastern time
to UTC and add 8 hours (no Daylight Savings Time
in Asia).

Now I'm trying to do something similar in Hong Kong
to convert Eastern time to Hong Kong, but I can't
seem to find an easy way to do this, since the
machines have TZ=CST (Hong Kong time) and there's
no obvious (to me) way to temporarily make the
script pretend it's in Eastern time to figure
out if it's EDT or EST.  (even if I set time.altzone
time.timezone and time.tz, the time module looks
to use the system values for these - i.e. the
variables reflect the system but aren't used for
calculations).

So, basically, I have a timestamp 1999-10-01-1030
Eastern time and need to figure out if it's daylight (+1)
or standard  (+0) and then add the offset of +13.

I could hardcode this to work for a few years, but
that's not very elegant.

Ideas?

Thanks,
Bill
--
Bill Eldridge
Radio Free Asia
bill at hk.rfa.org




More information about the Python-list mailing list