This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

mktime()


Hi gang;
  Came across a discrepancy in the handling between localtime and mktime. In the file mktm_r.c, the function _mktm_r has:
      res->tm_yday = 365 + isleap(res->tm_year);
I believe it should be:
      res->tm_yday = 364 + isleap(res->tm_year);
A test using localtime to create the broken-down time, then perform the inverse, mktime, showed that localtime created tm_yday of 365 then mktime corrected it to 364.

Cheers,
Steve


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]