
Q: conversion between timezones
I have hoping someone could help me with a couple of
questions.
1) strftime() converts time string into struct tm but
it does not fill in timezone and gmtoff fields. Are
there some functions which will do that given a
timezone string?
2) I was trying to convert time in struct tm into the
system's timezone. I created a struct tm and
explicitly set timezone to "EDT" and gmtoff to -14400L.
Then I called timelocal() to convert it into a time_t
and then use localtime() to convert the time_t back to
a struct tm. It did not give me the desired result but
simply replaced the timezone field back to "PDT", my
system's timezone. What was the thing that I did
wrong? Is there some better ways of doing it?
You help is appreciated.
--
-----
-hoki