mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-10 07:54:17 +00:00
synchronized timestamp functions and the format used
This commit is contained in:
parent
8c49b9c6c0
commit
db719434e5
@ -245,17 +245,7 @@ static lg::log_domain log_server("server");
|
||||
{
|
||||
if (start_time_ == 0)
|
||||
return "unknown";
|
||||
return banned::get_human_time(start_time_);
|
||||
}
|
||||
|
||||
std::string banned::get_human_time(const time_t& time)
|
||||
{
|
||||
char buf[30];
|
||||
struct tm* local;
|
||||
local = localtime(&time);
|
||||
strftime(buf,30,"%H:%M:%S %d.%m.%Y", local );
|
||||
return std::string(buf);
|
||||
|
||||
return lg::get_timestamp(start_time_, "%H:%M:%S %d.%m.%Y");
|
||||
}
|
||||
|
||||
std::string banned::get_human_end_time() const
|
||||
@ -264,7 +254,7 @@ static lg::log_domain log_server("server");
|
||||
{
|
||||
return "permanent";
|
||||
}
|
||||
return banned::get_human_time(end_time_);
|
||||
return lg::get_timestamp(end_time_, "%H:%M:%S %d.%m.%Y");
|
||||
}
|
||||
|
||||
bool banned::operator>(const banned& b) const
|
||||
|
@ -57,7 +57,6 @@
|
||||
#include <cassert>
|
||||
#include <cerrno>
|
||||
#include <cstdlib>
|
||||
#include <ctime>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
@ -1613,7 +1612,7 @@ std::string server::process_command(std::string query, std::string issuer_name)
|
||||
if (pl != players_.end()) {
|
||||
out << std::endl << player_status(pl);
|
||||
} else {
|
||||
out << "\n'" << username << "' @ " << ip << " last seen: " << ctime(&(i->log_off));
|
||||
out << "\n'" << username << "' @ " << ip << " last seen: " << lg::get_timestamp(i->log_off, "%H:%M:%S %d.%m.%Y");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user