diff options
Diffstat (limited to 'src/utils/stringutils.cpp')
-rw-r--r-- | src/utils/stringutils.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp index 8daaf3be2..cc9e830b8 100644 --- a/src/utils/stringutils.cpp +++ b/src/utils/stringutils.cpp @@ -1,11 +1,11 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2007-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -947,8 +947,14 @@ std::string timeToStr(const uint32_t time) char buf[101]; const time_t tempTime = time; tm *const timeInfo = localtime(&tempTime); - if (strftime(&buf[0], 100, "%Y-%m-%d_%H-%M-%S", timeInfo) != 0U) + PRAGMA8(GCC diagnostic push) + PRAGMA8(GCC diagnostic ignored "-Wformat-y2k") + // %c is locale-defined format. gcc8 complains: + // '%c' yields only last 2 digits of year in some locales. + // However, mails *currently, on ML* expire in way less than a year. + if (strftime(&buf[0], 100, "%c", timeInfo) != 0U) return std::string(buf); + PRAGMA8(GCC diagnostic pop) return "unknown"; } |