"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "time/unix/time.c" between
apr-1.6.5.tar.bz2 and apr-1.7.0.tar.bz2

About: APR (Apache Portable Runtime) project offers software libraries that provide a predictable and consistent interface to underlying platform-specific implementations (APR core library).

time.c  (apr-1.6.5.tar.bz2):time.c  (apr-1.7.0.tar.bz2)
skipping to change at line 145 skipping to change at line 145
#endif /* __EMX__ */ #endif /* __EMX__ */
} }
APR_DECLARE(apr_status_t) apr_time_exp_get(apr_time_t *t, apr_time_exp_t *xt) APR_DECLARE(apr_status_t) apr_time_exp_get(apr_time_t *t, apr_time_exp_t *xt)
{ {
apr_time_t year = xt->tm_year; apr_time_t year = xt->tm_year;
apr_time_t days; apr_time_t days;
static const int dayoffset[12] = static const int dayoffset[12] =
{306, 337, 0, 31, 61, 92, 122, 153, 184, 214, 245, 275}; {306, 337, 0, 31, 61, 92, 122, 153, 184, 214, 245, 275};
if (xt->tm_mon < 0 || xt->tm_mon >= 12)
return APR_EBADDATE;
/* shift new year to 1st March in order to make leap year calc easy */ /* shift new year to 1st March in order to make leap year calc easy */
if (xt->tm_mon < 2) if (xt->tm_mon < 2)
year--; year--;
/* Find number of days since 1st March 1900 (in the Gregorian calendar). */ /* Find number of days since 1st March 1900 (in the Gregorian calendar). */
days = year * 365 + year / 4 - year / 100 + (year / 100 + 3) / 4; days = year * 365 + year / 4 - year / 100 + (year / 100 + 3) / 4;
days += dayoffset[xt->tm_mon] + xt->tm_mday - 1; days += dayoffset[xt->tm_mon] + xt->tm_mday - 1;
days -= 25508; /* 1 jan 1970 is 25508 days since 1 mar 1900 */ days -= 25508; /* 1 jan 1970 is 25508 days since 1 mar 1900 */
 End of changes. 1 change blocks. 
3 lines changed or deleted 0 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)