CMS 3D CMS Logo

List of all members | Public Member Functions
HCAL_HLX::TimeStamp Class Reference

#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)
 

Detailed Description

Definition at line 9 of file TimeStamp.h.

Member Function Documentation

std::string HCAL_HLX::TimeStamp::TimeStampLong ( time_t  rawtime = 0)

Definition at line 6 of file TimeStamp.cc.

References protons_cff::time.

6  {
7 
8  if( rawtime == 0 )
9  time(&rawtime);
10 
11  return ctime(&rawtime);
12 }
std::string HCAL_HLX::TimeStamp::TimeStampYYYYMM ( time_t  rawtime = 0)

Definition at line 14 of file TimeStamp.cc.

References AlCaHLTBitMon_QueryRunRegistry::string, and TimeStampYYYYMMDD().

14  {
15 
16  std::string tempStr = TimeStampYYYYMMDD( rawtime );
17  return tempStr.substr(0,6);
18 }
std::string TimeStampYYYYMMDD(time_t rawtime=0)
Definition: TimeStamp.cc:20
std::string HCAL_HLX::TimeStamp::TimeStampYYYYMMDD ( time_t  rawtime = 0)

Definition at line 20 of file TimeStamp.cc.

References MillePedeFileConverter_cfg::out, AlCaHLTBitMon_QueryRunRegistry::string, and protons_cff::time.

Referenced by TimeStampYYYYMM().

20  {
21 
22  if( rawtime == 0 )
23  time(&rawtime);
24 
25  struct tm* timeinfo;
26  timeinfo = localtime(&rawtime);
27 
28  std::ostringstream out;
29  out.str(std::string());
30  out << std::setfill('0') << std::setw(4) << timeinfo->tm_year + 1900;
31  out << std::setfill('0') << std::setw(2) << timeinfo->tm_mon + 1;
32  out << std::setfill('0') << std::setw(2) << timeinfo->tm_mday;
33 
34  return out.str();
35 }