mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
1cf71a476b
commit
84166a4ee7
9 changed files with 69 additions and 34 deletions
|
@ -201,7 +201,7 @@ void put_HTML_date(struct membuffer *b, struct dive *dive, const char *pre, cons
|
|||
{
|
||||
struct tm tm;
|
||||
utc_mkdate(dive->when, &tm);
|
||||
put_format(b, "%s%04u-%02u-%02u%s", pre, tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, post);
|
||||
put_format(b, "%s%04u-%02u-%02u%s", pre, tm.tm_year, tm.tm_mon + 1, tm.tm_mday, post);
|
||||
}
|
||||
|
||||
void put_HTML_quoted(struct membuffer *b, const char *text)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue