How do I read in GMT time

How do I read in GMT time

Post by David Meiklejo » Sat, 23 Sep 1995 04:00:00



Hello,
        I'm writing a program which reads times in from a database, in both GMT
and local formats. I can use mktime() to convert a struct tm to a time_t, as long
as the time structure represents local time. The manual says a timegm() function
exists to convert from a GMT representation to a time_t, but this function isn't
in /usr/include/time.h.

        Anyone know how to do this? I can only think of changing the current
timezone environment variable (TZ) to 'GMT', using mktime() and changing TZ back
again. This doesn't seem sensible.

        I'm using Solaris 2.4 by the way, with the Sparcworks C++ compiler.

        Please reply in e-mail if possible.

        Thanks,
                                                        David.

--

-------------------------------------------------------------------------------
David Meiklejohn        | 'How did you get all those coins?' asked Mort.

-------------------------------------------------------------------------------