From a98309a2236c98ce5a94e1afa14cf353ba683776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org> Date: Fri, 20 Nov 2020 15:36:07 +0100 Subject: [PATCH] Dynare++: (really) avoid locale-specific strings in the journal under Windows Closes: #1751 (cherry picked from commit 233b242a29c50d19927d12ba447bc7e115cb921a) --- dynare++/kord/journal.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dynare++/kord/journal.cc b/dynare++/kord/journal.cc index 50822a0b70..3ddfcef1ce 100644 --- a/dynare++/kord/journal.cc +++ b/dynare++/kord/journal.cc @@ -220,7 +220,14 @@ Journal::printHeader() << "\n\nStart time: "; std::time_t t = std::time(nullptr); // NB: in the date/time string, we avoid using locale-specific strings (#1751) - *this << std::put_time(std::localtime(&t), "%F %T %z") + *this << std::put_time(std::localtime(&t), +#ifndef _WIN32 + "%F %T %z" +#else + // Specifiers introduced in C++11 don’t work under Windows… + "%Y-%m-%d %H:%M:%S" +#endif + ) << "\n\n" << u8" ┌────╼ elapsed time (seconds) \n" << u8" │ ┌────╼ record unique identifier \n" -- GitLab