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 70fa79a commit 4838452Copy full SHA for 4838452
1 file changed
libs/rtefsutils/src/RteFsUtils.cpp
@@ -926,7 +926,15 @@ std::string RteFsUtils::FileTimeToString(const fs::file_time_type& timeStamp) {
926
auto sctp = std::chrono::time_point_cast<std::chrono::system_clock::duration>(
927
timeStamp - fs::file_time_type::clock::now() + std::chrono::system_clock::now());
928
std::time_t cftime = std::chrono::system_clock::to_time_t(sctp);
929
- strTime = std::asctime(std::localtime(&cftime));
+ std::tm tm{};
930
+#if defined(_WIN32)
931
+ localtime_s(&tm, &t); // Windows secure version
932
+#else
933
+ localtime_r(&t, &tm); // POSIX thread-safe version
934
+#endif
935
+ std::ostringstream oss;
936
+ oss << std::put_time(&tm, "%Y-%m-%d %H:%M:%S");
937
+ strTime = oss.str();
938
}
939
return strTime;
940
0 commit comments