mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-25 05:55:13 +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 "IRCWindowListModel.h"
|
||||||
#include <AK/QuickSort.h>
|
#include <AK/QuickSort.h>
|
||||||
#include <AK/StringBuilder.h>
|
#include <AK/StringBuilder.h>
|
||||||
|
#include <LibCore/DateTime.h>
|
||||||
#include <LibCore/Notifier.h>
|
#include <LibCore/Notifier.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
@ -625,16 +626,8 @@ void IRCClient::handle_rpl_topicwhotime(const Message& msg)
|
||||||
auto setat = msg.arguments[3];
|
auto setat = msg.arguments[3];
|
||||||
bool ok;
|
bool ok;
|
||||||
time_t setat_time = setat.to_uint(ok);
|
time_t setat_time = setat.to_uint(ok);
|
||||||
if (ok) {
|
if (ok)
|
||||||
auto* tm = localtime(&setat_time);
|
setat = Core::DateTime::from_timestamp(setat_time).to_string();
|
||||||
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);
|
|
||||||
}
|
|
||||||
ensure_channel(channel_name).add_message(String::format("*** (set by %s at %s)", nick.characters(), setat.characters()), Color::Blue);
|
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