This commit is contained in:
parent
d5410b88a3
commit
54828600a8
@ -73,16 +73,10 @@ auto s3_provider::convert_api_date(std::string_view date) -> std::uint64_t {
|
|||||||
struct tm tm1 {};
|
struct tm tm1 {};
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
utils::time::strptime(date_time.c_str(), "%Y-%m-%dT%T", &tm1);
|
utils::time::strptime(date_time.c_str(), "%Y-%m-%dT%T", &tm1);
|
||||||
|
return nanos + utils::time::windows_time_t_to_unix_time(_mkgmtime(&tm1));
|
||||||
auto utc_time = _mkgmtime(&tm1);
|
|
||||||
localtime_s(&tm1, &utc_time);
|
|
||||||
return nanos + utils::time::windows_time_t_to_unix_time(mktime(&tm1));
|
|
||||||
#else // !defined(_WIN32)
|
#else // !defined(_WIN32)
|
||||||
strptime(date_time.c_str(), "%Y-%m-%dT%T", &tm1);
|
strptime(date_time.c_str(), "%Y-%m-%dT%T", &tm1);
|
||||||
|
return nanos + (static_cast<std::uint64_t>(timegm(&tm1)) *
|
||||||
auto utc_time = timegm(&tm1);
|
|
||||||
return nanos +
|
|
||||||
(static_cast<std::uint64_t>(mktime(localtime_r(&utc_time, &tm1))) *
|
|
||||||
utils::time::NANOS_PER_SECOND);
|
utils::time::NANOS_PER_SECOND);
|
||||||
#endif // defined(_WIN32)
|
#endif // defined(_WIN32)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user