Skip to content

Commit a59aa47

Browse files
henri-gascWerWolv
andauthored
build: Update libfmt to 11.2.0 (#163)
* Update libfmt to 11.2.0 * Fix calling of std::localtime and replace fmt::gmtime with std::gmtime as well --------- Co-authored-by: Nik <werwolv98@gmail.com>
1 parent f73ac03 commit a59aa47

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

lib/source/pl/lib/std/time.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace pl::lib::libstd::time {
1313

14-
static u128 packTMValue(std::tm tm) {
14+
static u128 packTMValue(const std::tm &tm) {
1515
return
1616
(u128(tm.tm_sec) << 0) |
1717
(u128(tm.tm_min) << 8) |
@@ -57,9 +57,9 @@ namespace pl::lib::libstd::time {
5757
auto time = time_t(params[0].toUnsigned());
5858

5959
try {
60-
auto localTime = fmt::localtime(time);
60+
auto localTime = std::localtime(&time);
6161

62-
return { packTMValue(localTime) };
62+
return { packTMValue(*localTime) };
6363
} catch (const fmt::format_error&) {
6464
return u128(0);
6565
}
@@ -70,9 +70,9 @@ namespace pl::lib::libstd::time {
7070
auto time = time_t(params[0].toUnsigned());
7171

7272
try {
73-
auto gmTime = fmt::gmtime(time);
73+
auto gmTime = std::gmtime(&time);
7474

75-
return { packTMValue(gmTime) };
75+
return { packTMValue(*gmTime) };
7676
} catch (const fmt::format_error&) {
7777
return u128(0);
7878
}

0 commit comments

Comments
 (0)