mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-24 21:45:20 +00:00
IRCClient: Use Core::DateTime
This commit is contained in:
parent
5e42fe76d6
commit
24dfc5051a
Notes:
sideshowbarker
2024-07-19 09:25:49 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/24dfc5051a0
1 changed files with 3 additions and 10 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue