1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:17:44 +00:00

LibGUI: Use Core::DateTime in FileSystemModel

This commit is contained in:
Andreas Kling 2020-02-11 20:05:44 +01:00
parent e22283e5e6
commit 5e42fe76d6

View file

@ -28,6 +28,7 @@
#include <AK/HashMap.h>
#include <AK/NonnullOwnPtrVector.h>
#include <LibCore/DateTime.h>
#include <LibCore/Notifier.h>
#include <LibGUI/Model.h>
#include <sys/stat.h>
@ -126,14 +127,7 @@ public:
static String timestamp_string(time_t timestamp)
{
auto* tm = localtime(&timestamp);
return String::format("%4u-%02u-%02u %02u:%02u:%02u",
tm->tm_year + 1900,
tm->tm_mon + 1,
tm->tm_mday,
tm->tm_hour,
tm->tm_min,
tm->tm_sec);
return Core::DateTime::from_timestamp(timestamp).to_string();
}
private: