diff --git a/common/git/git_pull_handler.cpp b/common/git/git_pull_handler.cpp index 95507ec991..bedc30b0dd 100644 --- a/common/git/git_pull_handler.cpp +++ b/common/git/git_pull_handler.cpp @@ -208,7 +208,11 @@ std::string GIT_PULL_HANDLER::getFormattedCommitDate( const git_time& aTime ) char dateBuffer[64]; time_t time = static_cast( aTime.time ); struct tm timeInfo; - gmtime_r( &time, &timeInfo ); + #ifdef _WIN32 + localtime_s( &timeInfo, &time ); + #else + gmtime_r( &time, &timeInfo ); + #endif strftime( dateBuffer, sizeof( dateBuffer ), "%Y-%b-%d %H:%M:%S", &timeInfo ); return dateBuffer; } diff --git a/common/git/kicad_git_common.cpp b/common/git/kicad_git_common.cpp index 2e6c0adbfb..9a2ea404fc 100644 --- a/common/git/kicad_git_common.cpp +++ b/common/git/kicad_git_common.cpp @@ -29,6 +29,7 @@ #include #include +#include #include #include #include