Bug 131108
Summary: | unexpected one-hour offset in time conversions | ||||||
---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Eric Raymond <esr> | ||||
Component: | man-pages | Assignee: | Eido Inoue <havill> | ||||
Status: | CLOSED NOTABUG | QA Contact: | Ben Levenson <benl> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | 2 | CC: | roland | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | i686 | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2004-10-21 20:10:44 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Eric Raymond
2004-08-27 16:57:25 UTC
Created attachment 103171 [details]
Demonstrates an apparent bug in the time functions
What is unexpected there? "The mktime() function shall convert the broken-down time, expressed as local time,"... I've verified Solaris gives exactly the same results as Linux. This is not a bug. The C standard specifies that mktime consults the fields that the C standard specifies in struct tm, including tm_isdst. The fields such as tm_zone and tm_gmtoff that give information about what timezone to apply are extensions not specified by the C standard. mktime cannot consult these fields, as a standard C program defining its own struct tm might leave them as uninitialized garbage and be correct in doing so and expecting mktime to operate on the standard struct tm fields in the local time zone. If your local timezone (from TZ or /etc/localtime) has one-hour DST rules and your struct tm says tm_isdst, then it indicates the time the standard struct tm fields say, with the local timezone's UTC offset + 1 hour for DST. Then I request that a WARNING be added to the mktime() manual page explaining this situation. Don't think a warning is necessary-- man page seems pretty clear to me, and I don't see a lot of people tripping over this. |