Display last access date under files
This commit is contained in:
parent
87f5f74c86
commit
032db7f444
9 changed files with 86 additions and 22 deletions
|
|
@ -1,4 +1,6 @@
|
|||
#include "StringHelpers.hpp"
|
||||
#include <SDL3/SDL_timer.h>
|
||||
#include <chrono>
|
||||
#include <fstream>
|
||||
#include <algorithm>
|
||||
#include <regex>
|
||||
|
|
@ -114,3 +116,20 @@ std::string ensure_string_unique(const std::vector<std::string>& stringList, std
|
|||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
std::chrono::system_clock::time_point sdl_time_to_chrono_time(const SDL_Time& t) {
|
||||
time_t unixTime = SDL_NS_TO_SECONDS(t);
|
||||
return std::chrono::system_clock::from_time_t(unixTime);
|
||||
}
|
||||
|
||||
std::string chrono_time_to_nice_date(const std::chrono::system_clock::time_point& t, SDL_DateFormat f) {
|
||||
switch(f) {
|
||||
case SDL_DATE_FORMAT_YYYYMMDD:
|
||||
return std::format("{:%Y-%m-%d}", t);
|
||||
case SDL_DATE_FORMAT_DDMMYYYY:
|
||||
return std::format("{:%d %b, %Y}", t);
|
||||
case SDL_DATE_FORMAT_MMDDYYYY:
|
||||
return std::format("{:%b %d, %Y}", t);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue