Replace deprecated timelocal() with mktime().
continuous-integration/drone/push Build is passing Details

This commit is contained in:
tastytea 2019-11-27 02:11:30 +01:00
parent b585a543fb
commit e1ad1a3588
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 2 additions and 2 deletions

View File

@ -30,7 +30,7 @@ time_point string_to_timepoint(const string &strtime, bool sqlite)
{
std::stringstream sstime(strtime);
struct std::tm tm = {};
tm.tm_isdst = -1; // Detect daylight saving time.
tm.tm_isdst = -1; // Don't convert to/from daylight saving time.
if (sqlite)
{
sstime >> std::get_time(&tm, "%Y-%m-%d %T");
@ -39,7 +39,7 @@ time_point string_to_timepoint(const string &strtime, bool sqlite)
{
sstime >> std::get_time(&tm, "%Y-%m-%dT%T");
}
std::time_t time = timelocal(&tm); // Assume time is local.
std::time_t time = mktime(&tm);
return system_clock::from_time_t(time);
}