Re: tm_gmtoff
- From: Dave Yeo <dave.r.yeo@xxxxxxxxx>
- Date: Sat, 31 Jan 2009 19:19:22 GMT
On 01/30/09 05:14 pm, John Small wrote:
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?
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
.
- References:
- tm_gmtoff
- From: John Small
- tm_gmtoff
- Prev by Date: Re: tm_gmtoff
- Next by Date: Re: makefile with "ln"
- Previous by thread: Re: tm_gmtoff
- Next by thread: Re: Palvontamenojen suunnittelua
- Index(es):
Relevant Pages
|