commit f84764d953774de58cea69fdfe6fca9cc903a25d parent b01d7417ea747fa2dbd2473cb10b8bef060404da Author: Martin Costello <martin@martincostello.com> Date: Wed, 31 Mar 2021 18:52:57 +0100 Fix date formatting (#836) Ensure that day and month are padded with zeroes. Diffstat:
| M | src/AppInstallerCommonCore/DateTime.cpp | | | 4 | ++-- |
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/AppInstallerCommonCore/DateTime.cpp b/src/AppInstallerCommonCore/DateTime.cpp @@ -16,8 +16,8 @@ namespace AppInstaller::Utility stream << std::setw(4) << (1900 + localTime.tm_year) << '-' - << std::setw(2) << (1 + localTime.tm_mon) << '-' - << std::setw(2) << localTime.tm_mday << (useRFC3339 ? 'T' : ' ') + << std::setw(2) << std::setfill('0') << (1 + localTime.tm_mon) << '-' + << std::setw(2) << std::setfill('0') << localTime.tm_mday << (useRFC3339 ? 'T' : ' ') << std::setw(2) << std::setfill('0') << localTime.tm_hour << ':' << std::setw(2) << std::setfill('0') << localTime.tm_min << ':' << std::setw(2) << std::setfill('0') << localTime.tm_sec << '.';