Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Sun, 8 Feb 2004 10:40:15 -0800 From: Yitzchak Scott-Thoennes To: cygwin AT cygwin DOT com Subject: localtime_r not returning local time Message-ID: <20040208184015.GB880@efn.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i Organization: bs"d X-IsSubscribed: yes 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 DOT 0 DOT 8-26136-75339 DOT 11 DOT 8378531676315 AT perl DOT 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 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/