mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 23:10:05 +00:00
Don't display epoch on map overlay
This commit is contained in:
parent
7c44bafeb5
commit
78a16b6a99
3 changed files with 16 additions and 10 deletions
|
|
@ -22,20 +22,24 @@ std::chrono::system_clock::time_point TimePoint(uint16_t modifiedJulianDate,
|
|||
}
|
||||
|
||||
std::string TimeString(std::chrono::system_clock::time_point time,
|
||||
const std::chrono::time_zone* timeZone)
|
||||
const std::chrono::time_zone* timeZone,
|
||||
bool epochValid)
|
||||
{
|
||||
using namespace std::chrono;
|
||||
auto timeInSeconds = time_point_cast<seconds>(time);
|
||||
std::ostringstream os;
|
||||
|
||||
if (timeZone != nullptr)
|
||||
if (epochValid || time.time_since_epoch().count() != 0)
|
||||
{
|
||||
zoned_time zt = {current_zone(), timeInSeconds};
|
||||
os << zt;
|
||||
}
|
||||
else
|
||||
{
|
||||
os << timeInSeconds;
|
||||
if (timeZone != nullptr)
|
||||
{
|
||||
zoned_time zt = {current_zone(), timeInSeconds};
|
||||
os << zt;
|
||||
}
|
||||
else
|
||||
{
|
||||
os << timeInSeconds;
|
||||
}
|
||||
}
|
||||
|
||||
return os.str();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue