Wireshark mailing list archives

Bug 5653 - Display "Day of Year" for January 1 as 1, not 0


From: Matthew Parris <parrisimo () gmail com>
Date: Mon, 7 Feb 2011 07:52:30 -0500

I'd like some others to comment regarding this proposed change.  See Bug
5653 <https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5653>.


In to_str.c, the abs_time_to_str and abs_time_secs_to_str functions creates a
string for display using gmtime.  This patch affects those using the
"ABSOLUTE_TIME_DOY_UTC" conversion case.

The tm_yday "Day of Year" parameter is defined by gmtime as "The number of days
since January 1, in the range 0 to 365"  so the tm_yday parameter equals zero
for January 1.  Similarly, the tm_year "Year" is defined as "The number of
years since 1900" so the tm_year parameter equals zero for 1900.

Within the abs_time_to_str function, 1900 is added to the tm_year parameter,
but 1 is not added to the tm_yday.  I'm used to seeing the day of the year
equal to 1 on January 1st.  Does anyone use 0 for January 1?


___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe

Current thread: