added: container LastContainer (lastcontainer.h lastcontainer.cpp)
it consists of last logged users added: function 'last' git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@492 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -210,11 +210,36 @@ static char buffer[100];
|
||||
}
|
||||
|
||||
|
||||
const char * DateToStr(tm * ptm)
|
||||
{
|
||||
return DateToStr(ptm->tm_year + 1900, ptm->tm_mon+1, ptm->tm_mday, ptm->tm_hour, ptm->tm_min, ptm->tm_sec);
|
||||
}
|
||||
|
||||
|
||||
const char * DateToStr(time_t t)
|
||||
{
|
||||
tm * ptm = std::localtime(&t);
|
||||
|
||||
return DateToStr(ptm->tm_year + 1900, ptm->tm_mon, ptm->tm_mday, ptm->tm_hour, ptm->tm_min, ptm->tm_sec);
|
||||
return DateToStr(ptm);
|
||||
}
|
||||
|
||||
|
||||
const char * IpToStr(unsigned int ip_)
|
||||
{
|
||||
static char buffer[100];
|
||||
|
||||
union
|
||||
{
|
||||
unsigned int ip;
|
||||
unsigned char c[4];
|
||||
} ip;
|
||||
|
||||
ip.ip = ip_;
|
||||
|
||||
sprintf(buffer, "%u.%u.%u.%u", (int)ip.c[0], (int)ip.c[1], (int)ip.c[2], (int)ip.c[3]);
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user