summaryrefslogtreecommitdiff
path: root/Applications
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-02-11 20:42:51 +0100
committerAndreas Kling <kling@serenityos.org>2020-02-11 20:43:32 +0100
commit24dfc5051a0635f7d336b9c6500e23ee152a98d1 (patch)
tree413509190ef88044835d481c0fcdde3ea42c78cb /Applications
parent5e42fe76d6e0f51145f9c4056fe51ea4501321da (diff)
downloadserenity-24dfc5051a0635f7d336b9c6500e23ee152a98d1.zip
IRCClient: Use Core::DateTime
Diffstat (limited to 'Applications')
-rw-r--r--Applications/IRCClient/IRCClient.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/Applications/IRCClient/IRCClient.cpp b/Applications/IRCClient/IRCClient.cpp
index 5ec1b24419..f4fa61cd42 100644
--- a/Applications/IRCClient/IRCClient.cpp
+++ b/Applications/IRCClient/IRCClient.cpp
@@ -33,6 +33,7 @@
#include "IRCWindowListModel.h"
#include <AK/QuickSort.h>
#include <AK/StringBuilder.h>
+#include <LibCore/DateTime.h>
#include <LibCore/Notifier.h>
#include <arpa/inet.h>
#include <netinet/in.h>
@@ -625,16 +626,8 @@ void IRCClient::handle_rpl_topicwhotime(const Message& msg)
auto setat = msg.arguments[3];
bool ok;
time_t setat_time = setat.to_uint(ok);
- if (ok) {
- auto* tm = localtime(&setat_time);
- setat = 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);
- }
+ if (ok)
+ setat = Core::DateTime::from_timestamp(setat_time).to_string();
ensure_channel(channel_name).add_message(String::format("*** (set by %s at %s)", nick.characters(), setat.characters()), Color::Blue);
}