diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-04-28 15:13:30 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-04-29 09:07:17 -0700 |
commit | 84166a4ee77502bdb4a981bc5404a1a970c579cc (patch) | |
tree | beb4515e12d9f12f9e239d1c257d49b16cb9e031 /core/statistics.c | |
parent | 1cf71a476b243f2659cad72f251efe73e51d7e23 (diff) | |
download | subsurface-84166a4ee77502bdb4a981bc5404a1a970c579cc.tar.gz |
Extend time parsing to before 1970
It turns out that we are starting to have users that have logs that go
back that far. It won't be common, but let's get it right anyway.
NOTE! With us now supporting dates earlier in 1900, this also makes
"utc_mktime()" always add the "1900" to the year field. That way we
avoid ever using the fairly ambiguous two-digit shorthand.
It didn't use to be all that ambiguous when we knew that any two-digit
number less than 70 had to be 2000+. Now that we support going back to
earlier in the last centiry, that certainty is eroding.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/statistics.c')
-rw-r--r-- | core/statistics.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/statistics.c b/core/statistics.c index 6a05cffc1..1b9865443 100644 --- a/core/statistics.c +++ b/core/statistics.c @@ -160,10 +160,10 @@ void process_all_dives(struct dive *dive, struct dive **prev_dive) /* yearly statistics */ utc_mkdate(dp->when, &tm); if (current_year == 0) - current_year = tm.tm_year + 1900; + current_year = tm.tm_year; - if (current_year != tm.tm_year + 1900) { - current_year = tm.tm_year + 1900; + if (current_year != tm.tm_year) { + current_year = tm.tm_year; process_dive(dp, &(stats_yearly[++year_iter])); stats_yearly[year_iter].is_year = true; } else { |