changes
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
This commit is contained in:
parent
e81227e5f7
commit
3dc16db278
@ -73,10 +73,16 @@ auto s3_provider::convert_api_date(std::string_view date) -> std::uint64_t {
|
||||
struct tm tm1 {};
|
||||
#if defined(_WIN32)
|
||||
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)
|
||||
strptime(date_time.c_str(), "%Y-%m-%dT%T", &tm1);
|
||||
return nanos + (static_cast<std::uint64_t>(timegm(&tm1)) *
|
||||
auto utc_time = timegm(&tm1);
|
||||
auto *utc_tm = localtime(&utc_time);
|
||||
if (utc_tm != nullptr) {
|
||||
}
|
||||
return nanos + (static_cast<std::uint64_t>(mktime(&tm1)) *
|
||||
utils::time::NANOS_PER_SECOND);
|
||||
#endif // defined(_WIN32)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user