Fix build on Windows

(cherry picked from commit faf6243d1a)
This commit is contained in:
Seth Hillbrand
2025-03-23 10:53:44 -07:00
parent bf0bd05c75
commit c0d20fce9e
2 changed files with 6 additions and 1 deletions
+5 -1
View File
@@ -208,7 +208,11 @@ std::string GIT_PULL_HANDLER::getFormattedCommitDate( const git_time& aTime )
char dateBuffer[64];
time_t time = static_cast<time_t>( 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;
}