We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ccb4715 commit 536fe98Copy full SHA for 536fe98
source/matplot/core/axis_type.cpp
@@ -3,7 +3,13 @@
3
//
4
5
#include <cmath>
6
+#if defined(__unix__)
7
+#include <time.h>
8
+#elif defined(_WIN32)
9
10
+#else
11
#include <ctime>
12
+#endif
13
#include <matplot/core/axes_type.h>
14
#include <matplot/core/axis_type.h>
15
#include <matplot/core/figure_type.h>
@@ -257,7 +263,13 @@ namespace matplot {
257
263
char buff[20] = {0};
258
264
time_t now = (time_t)tick_values_[i];
259
265
struct tm buf;
266
267
+ localtime_r(&now, &buf);
268
260
269
localtime_s(&buf, &now);
270
271
+ buf = *std::localtime(&now);
272
261
273
strftime(buff, 20, tick_label_format_.c_str(), &buf);
262
274
r += "\"" + escape(std::string(buff)) + "\" ";
275
} else {
0 commit comments