From e5be97f2b974fc77d8900d52f9e5dbbcf9cfdc89 Mon Sep 17 00:00:00 2001 From: erikbs Date: Tue, 24 Feb 2026 00:28:39 +0100 Subject: [PATCH] FileUtils.C: do not convert timestamp via time_t --- src/web/FileUtils.C | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/web/FileUtils.C b/src/web/FileUtils.C index 67c31ae..40e23a8 100644 --- a/src/web/FileUtils.C +++ b/src/web/FileUtils.C @@ -69,15 +69,9 @@ namespace Wt { std::chrono::system_clock::time_point lastWriteTime(const std::string &file) { #ifdef WT_FILESYSTEM_IMPL_STD - #ifndef WT_FILESYSTEM_IMPL_STD_CLOCK_17 auto ftime = Wt::cpp17::filesystem::last_write_time(file); auto systime = decltype(ftime)::clock::to_sys(ftime); - return std::chrono::system_clock::from_time_t(decltype(systime)::clock::to_time_t(systime)); - #else // WT_FILESYSTEM_IMPL_STD_CLOCK_17 - LOG_DEBUG("When using cpp17 or lower with std::filesystem, the result of this function is an approximation. Use boost::filesystem, instead of std::filesystem (see WT_CPP17_FILESYSTEM_IMPLEMENTATION) if this is a problem for your application."); - auto ftime = Wt::cpp17::filesystem::last_write_time(file); - return std::chrono::time_point_cast(ftime - Wt::cpp17::filesystem::file_time_type::clock::now() + std::chrono::system_clock::now()); - #endif //WT_FILESYSTEM_IMPL_STD_CLOCK_17 + return std::chrono::time_point_cast(systime); #else // !WT_FILESYSTEM_IMPL_STD return std::chrono::system_clock::from_time_t(Wt::cpp17::filesystem::last_write_time(file)); #endif // WT_FILESYSTEM_IMPL_STD -- 2.52.0