mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 20:20:06 +00:00
Display clock format defined in settings on map
This commit is contained in:
parent
a7cb459e20
commit
5fb9dc6a5f
4 changed files with 55 additions and 9 deletions
|
|
@ -49,6 +49,7 @@ std::chrono::system_clock::time_point TimePoint(uint32_t modifiedJulianDate,
|
|||
}
|
||||
|
||||
std::string TimeString(std::chrono::system_clock::time_point time,
|
||||
ClockFormat clockFormat,
|
||||
const time_zone* timeZone,
|
||||
bool epochValid)
|
||||
{
|
||||
|
|
@ -65,12 +66,27 @@ std::string TimeString(std::chrono::system_clock::time_point time,
|
|||
{
|
||||
if (timeZone != nullptr)
|
||||
{
|
||||
zoned_time zt = {current_zone(), timeInSeconds};
|
||||
os << zt;
|
||||
zoned_time zt = {timeZone, timeInSeconds};
|
||||
|
||||
if (clockFormat == ClockFormat::_24Hour)
|
||||
{
|
||||
os << format("{:%Y-%m-%d %H:%M:%S %Z}", zt);
|
||||
}
|
||||
else
|
||||
{
|
||||
os << format("{:%Y-%m-%d %I:%M:%S %p %Z}", zt);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
os << timeInSeconds;
|
||||
if (clockFormat == ClockFormat::_24Hour)
|
||||
{
|
||||
os << format("{:%Y-%m-%d %H:%M:%S %Z}", timeInSeconds);
|
||||
}
|
||||
else
|
||||
{
|
||||
os << format("{:%Y-%m-%d %I:%M:%S %p %Z}", timeInSeconds);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue