test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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.

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.

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 GenerateHcalLaserBadRunList::out, and AlCaHLTBitMon_QueryRunRegistry::string.

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 }