[Bug 282916] The strptime() function in libc/stdtime parses an incorrect wday value with the %x format for dates after 12/31/00
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 282916] The strptime() function in libc/stdtime parses an incorrect wday value with the %x format for dates after 12/31/00"
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 282916] The strptime() function in libc/stdtime parses an incorrect wday value with the %x format for dates after 12/31/00"
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 282916] The strptime() function in libc/stdtime parses an incorrect wday value with the %x format for dates after 12/31/00"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 22 Nov 2024 10:36:14 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=282916
Bug ID: 282916
Summary: The strptime() function in libc/stdtime parses an
incorrect wday value with the %x format for dates
after 12/31/00
Product: Base System
Version: 14.1-RELEASE
Hardware: amd64
OS: Any
Status: New
Severity: Affects Only Me
Priority: ---
Component: bin
Assignee: bugs@FreeBSD.org
Reporter: erkki.moorits@mail.ee
Attachment #255388 text/plain
mime type:
Created attachment 255388
--> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=255388&action=edit
Test code for strptime(..., "%x", ...)
When I use strptime() input descriptor "%x" to decode date, then after 12/31/00
strptime() decodes wrong wday.
Here are the different test results from the attached test program.
Expected decoded values are (reference tests on Ubuntu Linux):
12/31/00:
Time: 00:00:00 Date: 2000-12-31
Wday: 0 Yday: 365 (DST 0 Zone [(null)] offset 0)
01/01/01:
Time: 00:00:00 Date: 2001-01-01
Wday: 1 Yday: 000 (DST 0 Zone [(null)] offset 0)
01/02/01:
Time: 00:00:00 Date: 2001-01-02
Wday: 2 Yday: 001 (DST 0 Zone [(null)] offset 0)
Actual values on FreeBSD 14.1-RELEASE-p5 GENERIC amd64:
12/31/00:
Time: 00:00:00 Date: 2000-12-31
Wday: 0 Yday: 365 (DST 0 Zone [(null)] offset 0)
01/01/01:
Time: 00:00:00 Date: 2001-01-01
Wday: 0 Yday: 000 (DST 0 Zone [(null)] offset 0)
01/02/01:
Time: 00:00:00 Date: 2001-01-02
Wday: 1 Yday: 001 (DST 0 Zone [(null)] offset 0)
Also wday values from %c and %x are different (first lines are decoded by using
%c, last by using %x):
Fri Mar 4 20:05:34 2005:
Time: 20:05:34 Date: 2005-03-04
Wday: 5 Yday: 062 (DST 0 Zone [(null)] offset 0)
03/04/05:
Time: 00:00:00 Date: 2005-03-04
Wday: 4 Yday: 062 (DST 0 Zone [(null)] offset 0)
--
You are receiving this mail because:
You are the assignee for the bug.