mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 17:40:05 +00:00
Index volume scan by time, change internal data structure from unordered to ordered map
This commit is contained in:
parent
e78231ac48
commit
efeb87baaa
9 changed files with 104 additions and 71 deletions
20
wxdata/source/scwx/util/time.cpp
Normal file
20
wxdata/source/scwx/util/time.cpp
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#include <scwx/util/time.hpp>
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
namespace util
|
||||
{
|
||||
|
||||
std::chrono::system_clock::time_point
|
||||
TimePoint(uint16_t modifiedJulianDate, uint32_t milliseconds)
|
||||
{
|
||||
using namespace std::chrono;
|
||||
using sys_days = time_point<system_clock, days>;
|
||||
constexpr auto epoch = sys_days {1969y / December / 31d};
|
||||
|
||||
return epoch + (modifiedJulianDate * 24h) +
|
||||
std::chrono::milliseconds {milliseconds};
|
||||
}
|
||||
|
||||
} // namespace qt
|
||||
} // namespace scwx
|
||||
Loading…
Add table
Add a link
Reference in a new issue