diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-27 20:23:44 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-27 20:23:44 +1000 |
commit | 332983c97b7a729c4dc5f19aa9ee4a22c420f7d8 (patch) | |
tree | fd9c441b796b522bdd5c7f8fbd32f51b8eff2a28 /source/core/StarTime_windows.cpp | |
parent | 14b9689b6d4f4ad5276c88130dc6e449bedc0709 (diff) |
The Formatting String Catastrophe
Diffstat (limited to 'source/core/StarTime_windows.cpp')
-rw-r--r-- | source/core/StarTime_windows.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/core/StarTime_windows.cpp b/source/core/StarTime_windows.cpp index 2b3e797..f1f10b4 100644 --- a/source/core/StarTime_windows.cpp +++ b/source/core/StarTime_windows.cpp @@ -14,13 +14,13 @@ String Time::printDateAndTime(int64_t epochTicks, String format) { ptm = localtime(&requestedTime); return format.replaceTags(StringMap<String>{ - {"year", strf("%04d", ptm->tm_year + 1900)}, - {"month", strf("%02d", ptm->tm_mon + 1)}, - {"day", strf("%02d", ptm->tm_mday)}, - {"hours", strf("%02d", ptm->tm_hour)}, - {"minutes", strf("%02d", ptm->tm_min)}, - {"seconds", strf("%02d", ptm->tm_sec)}, - {"millis", strf("%03d", (epochTicks % epochTickFrequency()) / (epochTickFrequency() / 1000))}, + {"year", strf("{:04d}", ptm->tm_year + 1900)}, + {"month", strf("{:02d}", ptm->tm_mon + 1)}, + {"day", strf("{:02d}", ptm->tm_mday)}, + {"hours", strf("{:02d}", ptm->tm_hour)}, + {"minutes", strf("{:02d}", ptm->tm_min)}, + {"seconds", strf("{:02d}", ptm->tm_sec)}, + {"millis", strf("{:03d}", (epochTicks % epochTickFrequency()) / (epochTickFrequency() / 1000))}, }); } |