summaryrefslogtreecommitdiffstats
path: root/cdf_time.c
diff options
context:
space:
mode:
Diffstat (limited to 'cdf_time.c')
-rw-r--r--cdf_time.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cdf_time.c b/cdf_time.c
index ee04fb6..5061b46 100644
--- a/cdf_time.c
+++ b/cdf_time.c
@@ -27,7 +27,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: cdf_time.c,v 1.10 2011/02/10 17:03:16 christos Exp $")
+FILE_RCSID("@(#)$File: cdf_time.c,v 1.11 2011/12/13 13:48:41 christos Exp $")
#endif
#include <time.h>
@@ -121,7 +121,7 @@ cdf_timestamp_to_timespec(struct timespec *ts, cdf_timestamp_t t)
tm.tm_year = (int)(CDF_BASE_YEAR + (t / 365));
rdays = cdf_getdays(tm.tm_year);
- t -= rdays;
+ t -= rdays - 1;
tm.tm_mday = cdf_getday(tm.tm_year, (int)t);
tm.tm_mon = cdf_getmonth(tm.tm_year, (int)t);
tm.tm_wday = 0;
OpenPOWER on IntegriCloud