]> WPIA git - cassiopeia.git/blobdiff - src/util.cpp
upd: fix problem with tm-initializer
[cassiopeia.git] / src / util.cpp
index 870359474b087098887d8c83179412a38c00440e..e721021b0de6d2105014ea4b05b42188010ab5b7 100644 (file)
@@ -89,16 +89,13 @@ std::pair<bool, time_t> parseDate( const std::string& date ) {
         return std::pair<bool, time_t>( false, 0 );
     }
 
-    std::tm t;
+    std::tm t = {};
     t.tm_sec = 0;
     t.tm_min = 0;
     t.tm_hour = 0;
-    t.tm_year = std::stoi( date.substr( 0, 4 ) ) - 1900;
-    t.tm_mon = std::stoi( date.substr( 5, 2 ) ) - 1;
     t.tm_mday = std::stoi( date.substr( 8, 2 ) );
-    t.tm_wday = 0;   /* Day of the week (0-6, Sunday = 0) */
-    t.tm_yday = 0;   /* Day in the year (0-365, 1 Jan = 0) */
-    t.tm_isdst = 0;  /* Daylight saving time */
+    t.tm_mon = std::stoi( date.substr( 5, 2 ) ) - 1;
+    t.tm_year = std::stoi( date.substr( 0, 4 ) ) - 1900;
 
     setenv( "TZ", "UTC", 1 );
     tzset();