]> pilppa.com Git - lib1wire.git/commitdiff
Year fix when for Date function.
authorMika Laitio <lamikr@pilppa.org>
Fri, 10 Dec 2010 16:16:30 +0000 (18:16 +0200)
committerMika Laitio <lamikr@pilppa.org>
Fri, 10 Dec 2010 16:16:30 +0000 (18:16 +0200)
time-function return years since 1900, so add 1900 to years in Date
function constructor.

Signed-off-by: Mika Laitio <lamikr@pilppa.org>
src/Date.cc

index b00d8a78270494c71a11deb229a9b7521787072f..b8b57140d2a4ea3dbd9d2f4c086d55d6a47b449c 100644 (file)
@@ -26,7 +26,7 @@ Date::Date() {
 
        time(&wtime);
        ltime   = localtime(&wtime);
-       year    = ltime->tm_year;
+       year    = 1900 + ltime->tm_year;
        month   = ltime->tm_mon;
        day     = ltime->tm_mday;
        hour    = ltime->tm_hour;