|
@@ -18,6 +18,7 @@
|
18
|
18
|
#include "yaml-cpp/yaml.h"
|
19
|
19
|
|
20
|
20
|
#include <chrono>
|
|
21
|
+#include <ctime>
|
21
|
22
|
#include <memory>
|
22
|
23
|
|
23
|
24
|
#include <iostream>
|
|
@@ -82,13 +83,20 @@ class LemmaObject {
|
82
|
83
|
// Alternative formulation
|
83
|
84
|
std::time_t now = std::chrono::system_clock::to_time_t( std::chrono::system_clock::now() );
|
84
|
85
|
std::stringstream out;
|
|
86
|
+
|
85
|
87
|
// use locale format
|
86
|
88
|
//out.imbue(std::locale("")); // use whatever is on the system
|
87
|
89
|
//out << std::put_time(std::localtime(& now), L"%c") ; // locale on system
|
88
|
90
|
// ISO-8601 format;
|
89
|
|
- out << std::put_time(std::localtime(& now), "%F %T %z");
|
90
|
|
- node["Serialized"] = out.str();
|
91
|
|
-
|
|
91
|
+ //out << std::put_time(std::localtime(& now), "%F %T %z");
|
|
92
|
+
|
|
93
|
+ // Use thread safe variant to suppress MSVC warning
|
|
94
|
+ struct tm timeinfo;
|
|
95
|
+ localtime_s(&timeinfo, &now);
|
|
96
|
+ // ISO-8601 format;
|
|
97
|
+ out << std::put_time(&timeinfo, "%F %T %z");
|
|
98
|
+
|
|
99
|
+ node["Serialized"] = out.str();
|
92
|
100
|
node["Lemma_VERSION"] = LEMMA_VERSION;
|
93
|
101
|
return node;
|
94
|
102
|
};
|