diff options
author | Andreas Kling <kling@serenityos.org> | 2020-02-11 20:05:08 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-02-11 20:43:29 +0100 |
commit | e22283e5e62cc0a80e1af2f6527f068d41bff188 (patch) | |
tree | 3172788b01da8709bbbfc933074884c4fb78a045 /Userland/ls.cpp | |
parent | 8f89cc85d109ecd98daa8402f909371779a07ecd (diff) | |
download | serenity-e22283e5e62cc0a80e1af2f6527f068d41bff188.zip |
Userland: Use Core::DateTime
Diffstat (limited to 'Userland/ls.cpp')
-rw-r--r-- | Userland/ls.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/Userland/ls.cpp b/Userland/ls.cpp index 019bb042c8..c2804344e8 100644 --- a/Userland/ls.cpp +++ b/Userland/ls.cpp @@ -30,6 +30,7 @@ #include <AK/StringBuilder.h> #include <AK/Vector.h> #include <LibCore/ArgsParser.h> +#include <LibCore/DateTime.h> #include <LibCore/DirIterator.h> #include <ctype.h> #include <dirent.h> @@ -271,14 +272,7 @@ bool print_filesystem_object(const String& path, const String& name, const struc } } - auto* tm = localtime(&st.st_mtime); - printf(" %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); + printf(" %s ", Core::DateTime::from_timestamp(st.st_mtime).to_string().characters()); print_name(st, name, path.characters()); |