Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Nov 2015 19:32:20 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 204529] struct tm documentation in time.h possibly incorrect
Message-ID:  <bug-204529-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204529

            Bug ID: 204529
           Summary: struct tm documentation in time.h possibly incorrect
           Product: Base System
           Version: 11.0-CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: michael.cress@cress.us

In time.h:

struct tm {
    int    tm_sec;        /* seconds after the minute [0-60] */
    int    tm_min;        /* minutes after the hour [0-59] */
    int    tm_hour;    /* hours since midnight [0-23] */
    int    tm_mday;    /* day of the month [1-31] */
    int    tm_mon;        /* months since January [0-11] */
    int    tm_year;    /* years since 1900 */
    int    tm_wday;    /* days since Sunday [0-6] */
    int    tm_yday;    /* days since January 1 [0-365] */
    int    tm_isdst;    /* Daylight Savings Time flag */
    long    tm_gmtoff;    /* offset from UTC in seconds */
    char    *tm_zone;    /* timezone abbreviation */
};

Is the documentation for tm_sec and tm_yday accurate? The range [0-60] for
tm_sec yeilds 61 values and [0-365] yields 366 values. Since other values are
in sensible ranges (e.g. tm_min -> [0-59]), I'm thinking this is an error. "man
3 gmtime" shows this same struct as well but makes no mention of these ranges
being special cases.

-- 
You are receiving this mail because:
You are the assignee for the bug.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-204529-8>