Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

tm_gmtoff

178 views
Skip to first unread message

John Small

unread,
Jan 30, 2009, 8:14:26 PM1/30/09
to
I am trying to port software which references tm_gmtoff as a member of
"struct tm".

However, I am using Paul Semdley's build evnironment and my time.h
has:
#if 0 /* bird: LIBC isn't implementing tm_gmtoff and tm_zone. */
long tm_gmtoff; /* offset from UTC in seconds */
char *tm_zone; /* timezone abbreviation */
#endif

This, of course, results in compilation errors.

Would it be appropriate to use:
tzset();
m_time -= timezone;
in place of:
if ((tm = localtime(&m_time)) != (struct tm *)NULL)
m_time -= tm->tm_gmtoff; /* sec. EAST of GMT:
subtr. */

Or is there a better solution?

--

John Small

Tellerbop

unread,
Jan 31, 2009, 3:38:32 AM1/31/09
to
On Sat, 31 Jan 2009 01:14:26 UTC, "John Small" <jsm...@os2world.net>
wrote:
Hi John,
I have port a prog that also had that error:

parser.c: In function 'parse_record_w3c':
parser.c:721: error: 'struct tm' has no member named 'tm_gmtoff'
make.exe: *** [parser.o] Error 1

I just comment out the line 721 and that fix that error..


--
With the best regards from the Netherlands,

John Small

unread,
Jan 31, 2009, 6:00:44 AM1/31/09
to
On Sat, 31 Jan 2009 08:38:32 UTC, "Tellerbop" <Tell...@wint.nl>
wrote:

> On Sat, 31 Jan 2009 01:14:26 UTC, "John Small" <jsm...@os2world.net>
> wrote:
> Hi John,

> > I am trying to port software which references tm_gmtoff as a member of
> > "struct tm".
> >
> > However, I am using Paul Semdley's build evnironment and my time.h
> > has:
> > #if 0 /* bird: LIBC isn't implementing tm_gmtoff and tm_zone. */
> > long tm_gmtoff; /* offset from UTC in seconds */
> > char *tm_zone; /* timezone abbreviation */
> > #endif
> >
> > This, of course, results in compilation errors.
> >
> I have port a prog that also had that error:
>
> parser.c: In function 'parse_record_w3c':
> parser.c:721: error: 'struct tm' has no member named 'tm_gmtoff'
> make.exe: *** [parser.o] Error 1
>
> I just comment out the line 721 and that fix that error..

It fixes the compilation error. But doesn't that mean you are losing
the functionality of whatever your line 721 is doing?

> > Would it be appropriate to use:
> > tzset();
> > m_time -= timezone;
> > in place of:
> > if ((tm = localtime(&m_time)) != (struct tm *)NULL)
> > m_time -= tm->tm_gmtoff; /* sec. EAST of GMT:
> > subtr. */
> >
> > Or is there a better solution?

--

John Small

Dave Yeo

unread,
Jan 31, 2009, 2:19:22 PM1/31/09
to

This looks like the correct solution. Just beware that tzset() is picky
about the value of %TZ%. See the emx 0.9d C library reference
Dave

0 new messages