fix leap year handling ...

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@1461 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 1998-12-20 20:39:08 +00:00
parent 6d25ae9dca
commit ffce06718c

View File

@ -407,8 +407,8 @@ xaccSetDateCellValueSecsL (DateCell *cell, long long secs)
struct tm * stm; struct tm * stm;
/* try to deal with dates earlier than December 1901 /* try to deal with dates earlier than December 1901
* or later than Jan 2038. Note that this blows off * or later than Jan 2038. Note that xaccValidateDate
* centenial leap years. */ * should be handling centential (non-) leap years. */
if ((0x80000000L > secs) || (0x7fffffffL < secs)) if ((0x80000000L > secs) || (0x7fffffffL < secs))
{ {
int yrs; int yrs;
@ -418,6 +418,7 @@ xaccSetDateCellValueSecsL (DateCell *cell, long long secs)
stm = localtime (&rem); stm = localtime (&rem);
cell->date = *stm; cell->date = *stm;
cell->date.tm_year += 32 * yrs; cell->date.tm_year += 32 * yrs;
xaccValidateDate (&(cell->date), 0);
} else { } else {
/* OK, time value is an unsigned 32-bit int */ /* OK, time value is an unsigned 32-bit int */
time_t sicko; time_t sicko;