#include <TimeStamp.h>
Public Member Functions | |
std::string | TimeStampLong (time_t rawtime=0) |
std::string | TimeStampYYYYMM (time_t rawtime=0) |
std::string | TimeStampYYYYMMDD (time_t rawtime=0) |
Definition at line 9 of file TimeStamp.h.
std::string HCAL_HLX::TimeStamp::TimeStampLong | ( | time_t | rawtime = 0 | ) |
Definition at line 6 of file TimeStamp.cc.
References cond::rpcobgas::time.
{ if( rawtime == 0 ) time(&rawtime); return ctime(&rawtime); }
std::string HCAL_HLX::TimeStamp::TimeStampYYYYMM | ( | time_t | rawtime = 0 | ) |
Definition at line 14 of file TimeStamp.cc.
{ std::string tempStr = TimeStampYYYYMMDD( rawtime ); return tempStr.substr(0,6); }
std::string HCAL_HLX::TimeStamp::TimeStampYYYYMMDD | ( | time_t | rawtime = 0 | ) |
Definition at line 20 of file TimeStamp.cc.
References dbtoconf::out, and cond::rpcobgas::time.
{ if( rawtime == 0 ) time(&rawtime); struct tm* timeinfo; timeinfo = localtime(&rawtime); std::ostringstream out; out.str(std::string()); out << std::setfill('0') << std::setw(4) << timeinfo->tm_year + 1900; out << std::setfill('0') << std::setw(2) << timeinfo->tm_mon + 1; out << std::setfill('0') << std::setw(2) << timeinfo->tm_mday; return out.str(); }