martinzink commented on code in PR #1518:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1518#discussion_r1121436831


##########
libminifi/include/utils/file/FileUtils.h:
##########
@@ -126,15 +126,24 @@ inline std::optional<std::filesystem::file_time_type> 
last_write_time(const std:
   return std::nullopt;
 }
 
-inline std::optional<std::string> format_time(const 
std::filesystem::file_time_type& time, const std::string& format) {
-  auto last_write_time_t = to_time_t(time);
+inline std::optional<std::string> format_time(const time_t& time, const 
std::string& format) {
   std::array<char, 128U> result{};
-  if (std::strftime(result.data(), result.size(), format.c_str(), 
gmtime(&last_write_time_t)) != 0) {
+  if (std::strftime(result.data(), result.size(), format.c_str(), 
gmtime(&time)) != 0) {
     return std::string(result.data());
   }
   return std::nullopt;
 }
 
+inline std::optional<std::string> format_time(const 
std::chrono::system_clock::time_point& time, const std::string& format) {

Review Comment:
   We have some time_point to str utilities in TimeUtil.h, that deal with these 
problem. (maybe we should change the input parameter from sys_seconds to 
std::chrono::system_clock::timepoint)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to