Discussion:
[avr-libc-dev] [bug #46303] eu_dst() in include/util/eu_dst.h returns wrong DST info (avr-libc 1.8.1)
Fred
2015-10-26 23:03:17 UTC
Permalink
URL:
<http://savannah.nongnu.org/bugs/?46303>

Summary: eu_dst() in include/util/eu_dst.h returns wrong DST
info (avr-libc 1.8.1)
Project: AVR C Runtime Library
Submitted by: fredavr
Submitted on: lun. 26 oct. 2015 23:03:16 GMT
Category: Header
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Header files
Status: None
Percent Complete: 0%
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: 1.8.0
Fixed Release: None

_______________________________________________________

Details:

Inside eu_dst(), 1 is subtracted from tmptr.tm_mday, which seems to give wrong
DST info. See the attached patch.



_______________________________________________________

File Attachments:


-------------------------------------------------------
Date: lun. 26 oct. 2015 23:03:16 GMT Name: eu_dst.h.patch Size: 819 o By:
fredavr

<http://savannah.nongnu.org/bugs/download.php?file_id=35310>

_______________________________________________________

Reply to this item at:

<http://savannah.nongnu.org/bugs/?46303>

_______________________________________________
Message posté via/par Savannah
http://savannah.nongnu.org/
Mike Rice
2015-10-27 09:09:04 UTC
Permalink
Update of bug #46303 (project avr-libc):

Status: None => Fixed
Percent Complete: 0% => 100%
Assigned to: None => swfltek
Open/Closed: Open => Closed


_______________________________________________________

Reply to this item at:

<http://savannah.nongnu.org/bugs/?46303>

_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
Fred
2015-10-27 20:10:22 UTC
Permalink
Follow-up Comment #1, bug #46303 (project avr-libc):

I think the bug is not fixed. eu_dst() tells me that DST does not apply on
2015-10-24 01:00:00 UTC. But it should.

From eu_dst() :

/* determine mday of last Sunday */
n = tmptr.tm_mday - 1;
n -= day_of_week;
n += 7;
d = n % 7; /* date of first Sunday */

n = 31 - d;
n /= 7; /* number of Sundays left in the month */

d = d + 7 * n; /* mday of final Sunday */

If we try with tmptr.tm_mday == 25 and day_of_week == 0 (for October 25th,
which is the last Sunday of October in 2015), then we get d == 31. Which is
actually the last Saturday of October.

_______________________________________________________

Reply to this item at:

<http://savannah.nongnu.org/bugs/?46303>

_______________________________________________
Message posté via/par Savannah
http://savannah.nongnu.org/

Loading...