///////////////////////////////////////////////////////////
///////////////// Have an itch? Scratch it! ///////////////
///////////////////////// SCRATCH /////////////////////////
///////////////////// A MUD Server ////////////////////
///////////////////// By: Jared Devall ////////////////////
///////////////////// Thanks: ////////////////////
///////////////////// DIKU/Merc/ROM ////////////////////
///////////////////// Aetas/Deus Gang ////////////////////
///////////////////// Beej ////////////////////
///////////////////////////////////////////////////////////
#include <time.h>
#include <string>
#include "timestamp.h"
#include "stringutil.h"
using namespace std;
Timestamp::Timestamp() {
}
string Timestamp::GetTime( ) {
char buf2[4096];
time_t rawTime;
struct tm * timeInfo;
time ( &rawTime );
timeInfo = localtime ( &rawTime );
strftime( buf2, 4096, "%X", timeInfo );
return string(buf2);
}
string Timestamp::GetDateTime( ) {
char buf2[4096];
time_t rawTime;
struct tm * timeInfo;
time ( &rawTime );
timeInfo = localtime ( &rawTime );
strftime( buf2, 4096, "%a %b %d %Y %X", timeInfo );
return string(buf2);
}