mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-26 17:32:33 +00:00
Merge pull request #2986
373d1d50
epee: use strptime instead of std::get_time, for compatibility (moneromooo-monero)
This commit is contained in:
commit
2d60c9b738
1 changed files with 3 additions and 3 deletions
|
@ -28,6 +28,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <time.h>
|
||||||
#include <boost/regex.hpp>
|
#include <boost/regex.hpp>
|
||||||
|
|
||||||
#include "misc_language.h"
|
#include "misc_language.h"
|
||||||
|
@ -149,9 +150,8 @@ POP_WARNINGS
|
||||||
else if (boost::regex_match (from, boost::regex("\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\dZ")))
|
else if (boost::regex_match (from, boost::regex("\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\dZ")))
|
||||||
{
|
{
|
||||||
// Convert to unix timestamp
|
// Convert to unix timestamp
|
||||||
std::tm tm = {};
|
struct tm tm;
|
||||||
std::istringstream ss(from);
|
if (strptime(from.c_str(), "%Y-%m-%dT%H:%M:%S", &tm))
|
||||||
if (ss >> std::get_time(&tm, "%Y-%m-%dT%H:%M:%S"))
|
|
||||||
to = std::mktime(&tm);
|
to = std::mktime(&tm);
|
||||||
} else
|
} else
|
||||||
ASSERT_AND_THROW_WRONG_CONVERSION();
|
ASSERT_AND_THROW_WRONG_CONVERSION();
|
||||||
|
|
Loading…
Reference in a new issue