fick put_time, alle meine homies nutzen strftime

This commit is contained in:
Oliver 2022-09-04 22:55:58 +02:00
parent a59b5bbace
commit 030f6c2dba
Signed by untrusted user: okaestne
GPG Key ID: 06A81B143EA9588F
1 changed files with 3 additions and 1 deletions

View File

@ -171,7 +171,9 @@ std::ostream& defaultEntryMetaTime(std::ostream& os, const Entry& e) {
// MinGW doesn't support the ISO8601 formatting characters like "%F" and "%T"
// ref: https://sourceforge.net/p/mingw-w64/bugs/793/
// Therefore, use a more verbose time string
return os << "[" << std::put_time(&tm, "%Y-%m-%d %H:%M:%S") << "]";
char buf[24];
std::strftime(buf, sizeof(buf), "[%Y-%m-%d %H:%M:%S]", &tm);
return os << buf;
}
std::ostream& defaultEntryMetaLevel(std::ostream& os, const Entry& e) {