synchronized timestamp functions and the format used

This commit is contained in:
Gunter Labes 2009-08-25 15:02:47 +00:00
parent 8c49b9c6c0
commit db719434e5
2 changed files with 3 additions and 14 deletions

View File

@ -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

View File

@ -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");
}
}
}