Date: Thu, 27 Oct 2022 20:39:15 -0500 From: Stephen Montgomery-Smith <montgomerysmithstephen@gmail.com> To: Warner Losh <imp@bsdimp.com> Cc: freebsd-hackers <freebsd-hackers@freebsd.org> Subject: Re: Equivalent of Linux timezone in FreeBSD Message-ID: <2b6cb2f9-79ec-576f-76ad-6b965e7cef86@FreeBSD.org> In-Reply-To: <CANCZdfpntEyQFg2qc8qkn=54JHHKtt43rSGf%2Bo=x4UK=4Z6sjQ@mail.gmail.com> References: <f8db389b-a882-13c4-bfc5-9cd1c56762ca@FreeBSD.org> <CANCZdfpntEyQFg2qc8qkn=54JHHKtt43rSGf%2Bo=x4UK=4Z6sjQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 10/27/22 14:32, Warner Losh wrote:
>
>
> On Thu, Oct 27, 2022 at 1:26 PM Stephen Montgomery-Smith
> <montgomerysmithstephen@gmail.com
> <mailto:montgomerysmithstephen@gmail.com>> wrote:
>
> I am attempting to port code that uses an external variable called
> timezone, which is defined in the Linux file time.h as the number of
> seconds West of UTC for the current timezone.
>
>
> Except it's not completely reliable on linux, since it's not a constant
> except for
> the few minutes around the current time.... You can't expect it to work
> around the
> cut-overs of daylight savings time, for example.
>
> Is there an equivalent of this in FreeBSD or other BSDs?
>
>
> getenv("TZ") will get the timezone for the current process.
>
> But what are you using this value for?
It is used inside
https://pub.ist.ac.at/~schloegl/biosig/prereleases/biosig4octave-3.0.1.src.tar.gz
- look in the file biosig4octave-3.0.1/src/mexSSAVE.cpp at line 205.
Maybe I'll contact the author of the code.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2b6cb2f9-79ec-576f-76ad-6b965e7cef86>
