From 332983c97b7a729c4dc5f19aa9ee4a22c420f7d8 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Tue, 27 Jun 2023 20:23:44 +1000 Subject: The Formatting String Catastrophe --- source/core/StarTime_windows.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source/core/StarTime_windows.cpp') 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{ - {"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))}, }); } -- cgit v1.2.3