project64/Source/Common/DateTimeClass.cpp

22 lines
380 B
C++
Raw Normal View History

2016-02-24 06:59:29 +00:00
#include "stdafx.h"
#include "DateTimeClass.h"
#include <time.h>
CDateTime::CDateTime()
{
m_time = time(NULL);
2016-02-24 06:59:29 +00:00
}
std::string CDateTime::Format(const char * format)
2016-02-24 06:59:29 +00:00
{
char buffer[100];
strftime(buffer, sizeof(buffer), format, localtime(&m_time));
2016-02-24 06:59:29 +00:00
return std::string(buffer);
}
2016-12-13 06:31:40 +00:00
CDateTime & CDateTime::SetToNow(void)
{
m_time = time(NULL);
return *this;
}