This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: mktime()
- From: Corinna Vinschen <vinschen at redhat dot com>
- To: newlib at sourceware dot org
- Date: Wed, 24 Aug 2011 13:07:49 +0200
- Subject: Re: mktime()
- References: <024BA7F5-0120-46ED-9325-3F0539F4B1B0@zoomtown.com>
- Reply-to: newlib at sourceware dot org
On Aug 22 14:31, Steven Abner wrote:
> Hi gang;
> Came across a discrepancy in the handling between localtime and mktime. In the file mktm_r.c, the function _mktm_r has:
> res->tm_yday = 365 + isleap(res->tm_year);
> I believe it should be:
> res->tm_yday = 364 + isleap(res->tm_year);
> A test using localtime to create the broken-down time, then perform the inverse, mktime, showed that localtime created tm_yday of 365 then mktime corrected it to 364.
I think you're right. Can you please send the simple testcase?
Thanks,
Corinna
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat