The Portable Way to Extract Date and Time from a File's mtime in C++ 0 ▲ Sandor Dargo's Blog 2 hours ago · Tech · hide · 0 comments After I finished my Time in C++ series, a reader asked a seemingly simple question: “What is the portable way to extract the year, month, day, hour, minute, and second from a file’s modification time? I tried, and I couldn’t get it to work reliably on macOS and Windows.” Fair question. You call std::filesystem::last_write_time(), you get back a time point, and you want the calendar compon... No comments yet. Log in to reply on the Fediverse. Comments will appear here.