This is the mail archive of the
cygwin
mailing list for the Cygwin project.
RE: localtime_r not returning local time
- From: "Rafael Kitover" <caelum at debian dot org>
- To: <cygwin at cygwin dot com>
- Date: Thu, 12 Feb 2004 13:10:03 -0800
- Subject: RE: localtime_r not returning local time
Would it be a lot of overhead to have something like tzset be called in the
bootstrap code for launching Cygwin programs? Or maybe just have a DLL global
default, based on windows time zone, and just allow processes to reset it for
themselves (and any children.)
--
Rafael
>-----Original Message-----
>From: cygwin-owner@cygwin.com [mailto:cygwin-owner@cygwin.com] On Behalf Of
>Yitzchak Scott-Thoennes
>Sent: Sunday, February 08, 2004 10:40 AM
>To: cygwin@cygwin.com
>Subject: localtime_r not returning local time
>
>localtime_r is (if no direct or indirect call to tzset has been made)
>returning UTC time.
>
>This is the source of the cygwin perl bug where perl's localtime() is
>returning UTC time. See:
>http://groups.google.com/groups?selm=rt-3.0.8-26136-
>75339.11.8378531676315@perl.org
>
>Perl does not ever directly call tzset (except when perl code calls
>POSIX::tzset). Should it do so (at least at startup), or should
>localtime_r be returning a TZ-based time even when tzset hasn't been
>called?
>
>My reading of susv3:
> "Local timezone information is used as though localtime() calls tzset().
>
> The relationship between a time in seconds since the Epoch used as
> an argument to localtime() and the tm structure (defined in the
> <time.h> header) is that the result shall be...corrected for timezone
> and any seasonal time adjustments...
>
> The same relationship shall apply for localtime_r().
> ...
> Unlike localtime(), the reentrant version is not required to set
> tzname.
>
>is that while localtime_r need not (should not?) set the daylight,
>timezone, and tzname globals, it should still use local time as if
>tzset had been called. Admittedly, the standard is vague on this
>point.
>
>--
>Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
>Problem reports: http://cygwin.com/problems.html
>Documentation: http://cygwin.com/docs.html
>FAQ: http://cygwin.com/faq/
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/