Re: Equivalent of Linux timezone in FreeBSD
- In reply to: Warner Losh : "Re: Equivalent of Linux timezone in FreeBSD"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 28 Oct 2022 01:39:15 UTC
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.