From 4f20df042f28210366d19b7f8da108a1108daa34 Mon Sep 17 00:00:00 2001 From: Ralf Schlatterbeck Date: Fri, 27 Jun 2014 22:10:19 +0200 Subject: [PATCH] Fix leap year computation --- apps/time/time.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/time/time.c b/apps/time/time.c index 0b60c90f9..d2f7719c8 100644 --- a/apps/time/time.c +++ b/apps/time/time.c @@ -44,13 +44,13 @@ gmtime_r (const time_t *timep, struct tm *ptm) ptm->tm_hour = t % 24; t /= 24; ptm->tm_wday = (t+4) % 7; - year = 70; + year = 1970; days = 0; while ((days += YDAYS (year)) <= t) { year++; } - ptm->tm_year = year; + ptm->tm_year = year - 1900; days -= YDAYS(year); t -= days; ptm->tm_yday = t;