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

◆ TimeStampLong()

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

Definition at line 6 of file TimeStamp.cc.

6  {
7  if (rawtime == 0)
8  time(&rawtime);
9 
10  return ctime(&rawtime);
11 }

References protons_cff::time.

◆ TimeStampYYYYMM()

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

Definition at line 13 of file TimeStamp.cc.

13  {
14  std::string tempStr = TimeStampYYYYMMDD(rawtime);
15  return tempStr.substr(0, 6);
16 }

References AlCaHLTBitMon_QueryRunRegistry::string.

◆ TimeStampYYYYMMDD()

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

Definition at line 18 of file TimeStamp.cc.

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

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

protons_cff.time
time
Definition: protons_cff.py:35
HCAL_HLX::TimeStamp::TimeStampYYYYMMDD
std::string TimeStampYYYYMMDD(time_t rawtime=0)
Definition: TimeStamp.cc:18
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31