Skip to content

Commit

Permalink
Fixed UtcString Months (#969)
Browse files Browse the repository at this point in the history
They were being counted from zero to eleven but now
use one to twelve as expected.
  • Loading branch information
andrew-lunarg committed Jan 26, 2023
1 parent 3d9c323 commit 4968caf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions framework/util/date_time.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,12 @@ std::string UtcString(const time_t seconds_since_epoch)
{
now_str += std::to_string(1900 + now_gm.tm_year);
now_str += '-';
if (now_gm.tm_mon < 10)
const auto month_base_one = 1 + now_gm.tm_mon;
if (month_base_one < 10)
{
now_str += '0';
}
now_str += std::to_string(now_gm.tm_mon);
now_str += std::to_string(month_base_one);
now_str += '-';
if (now_gm.tm_mday < 10)
{
Expand Down

0 comments on commit 4968caf

Please sign in to comment.