summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-02-11 20:05:44 +0100
committerAndreas Kling <kling@serenityos.org>2020-02-11 20:43:32 +0100
commit5e42fe76d6e0f51145f9c4056fe51ea4501321da (patch)
treecd39cc8c9f5d75a775b466568b0865b948377dc5 /Libraries
parente22283e5e62cc0a80e1af2f6527f068d41bff188 (diff)
downloadserenity-5e42fe76d6e0f51145f9c4056fe51ea4501321da.zip
LibGUI: Use Core::DateTime in FileSystemModel
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibGUI/FileSystemModel.h10
1 files changed, 2 insertions, 8 deletions
diff --git a/Libraries/LibGUI/FileSystemModel.h b/Libraries/LibGUI/FileSystemModel.h
index 9b54c4b0a3..02bc652075 100644
--- a/Libraries/LibGUI/FileSystemModel.h
+++ b/Libraries/LibGUI/FileSystemModel.h
@@ -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: