Skip to content

Instantly share code, notes, and snippets.

@hnw
Created December 11, 2019 11:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hnw/2b7e2035c1efccaa13ccb940b599faca to your computer and use it in GitHub Desktop.
Save hnw/2b7e2035c1efccaa13ccb940b599faca to your computer and use it in GitHub Desktop.
*** ext/date/lib/unixtime2tm.c~ 2019-08-28 12:01:15.000000000 +0900
--- ext/date/lib/unixtime2tm.c 2019-12-11 20:37:52.000000000 +0900
***************
*** 56,61 ****
--- 56,67 ----
cur_year += YEARS_PER_LYEAR_PERIOD * (tmp_days / DAYS_PER_LYEAR_PERIOD);
tmp_days -= DAYS_PER_LYEAR_PERIOD * (tmp_days / DAYS_PER_LYEAR_PERIOD);
}
+ printf("tmp_days=%lld, year=%lld\n", tmp_days, cur_year);
+ if (ts >= 0 && tmp_days == 0) {
+ cur_year -= YEARS_PER_LYEAR_PERIOD;
+ tmp_days += DAYS_PER_LYEAR_PERIOD;
+ }
+ printf("tmp_days=%lld, year=%lld\n", tmp_days, cur_year);
TIMELIB_DEBUG(printf("tmp_days=%lld, year=%lld\n", tmp_days, cur_year););
if (ts >= 0) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment