Fixed rounding error.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@5660 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2000-01-04 22:49:41 +00:00
parent 578d371939
commit 3cc1c7c14c
3 changed files with 7 additions and 6 deletions

View file

@ -852,13 +852,9 @@
- (int) yearOfCommonEra
{
int m, d, y;
int a;
// Get reference date in terms of days
a = (_seconds_since_ref+[_time_zone timeZoneSecondsFromGMT]) / 86400;
// Offset by Gregorian reference
a += GREGORIAN_REFERENCE;
[self gregorianDateFromAbsolute: a day: &d month: &m year: &y];
[self gregorianDateFromAbsolute: [self dayOfCommonEra]
day: &d month: &m year: &y];
return y;
}