monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: time offsets


From: Christian Hopp
Subject: Re: time offsets
Date: Tue, 13 Aug 2002 23:31:15 +0200 (CEST)

On 13 Aug 2002, Rory Toma wrote:

> In util.c I noticed that following code:
>
> <   timezone_h= -(timezone/3600)+daylight;
> <   timezone_m= abs(timezone/60)%60;
>
> Now, this wouldn't compile out of the box on FreeBSD, so I looked at
> some man pages.

I can only test on Linux and Solaris.  )-:

> Isn't something like:
>
> >   tm_now = localtime(&now);
> >
> >   timezone_h = -(tm_now->tm_gmtoff/3600);
> >   timezone_m = abs(tm_now->tm_gmtoff/60)%60;
>
> more portable?
Yep!

C.Hopp


-- 
Christian Hopp                                email: address@hidden
Institut für Elektrische Informationstechnik             fon: +49-5323-72-2113
Technische Universität Clausthal                         fax: +49-5323-72-3197
  pgpkey: https://www.iei.tu-clausthal.de/pgp-keys/chopp.key.asc  (2001-11-22)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]