ATLAS Offline Software
Static Public Member Functions | Private Member Functions | List of all members
VP1TimeUtilities Class Reference

#include <VP1TimeUtilities.h>

Collaboration diagram for VP1TimeUtilities:

Static Public Member Functions

static std::string getHumanReadableTimestamp (time_t t_timestamp)
 

Private Member Functions

 VP1TimeUtilities ()
 
 ~VP1TimeUtilities ()
 

Detailed Description

Definition at line 25 of file VP1TimeUtilities.h.

Constructor & Destructor Documentation

◆ VP1TimeUtilities()

VP1TimeUtilities::VP1TimeUtilities ( )
private

◆ ~VP1TimeUtilities()

VP1TimeUtilities::~VP1TimeUtilities ( )
private

Member Function Documentation

◆ getHumanReadableTimestamp()

std::string VP1TimeUtilities::getHumanReadableTimestamp ( time_t  t_timestamp)
static

Definition at line 24 of file VP1TimeUtilities.cxx.

25 {
26  struct tm ltm;
27  localtime_r(&t_timestamp, &ltm);
28 
29  std::string humanTimestamp;
30 
31  std::ostringstream ostri;
32  ostri << 1900 + ltm.tm_year
33  << "-" << 1 + ltm.tm_mon // tm_mon is in the range [0, 11], so 1 must be added to get real months
34  << "-" << ltm.tm_mday
35  << "T" << ltm.tm_hour << "-" << ltm.tm_min << "-" << ltm.tm_sec; // << "CEST"; FIXME: check if time zone is available on data file
36 
37  humanTimestamp = ostri.str();
38  //std::cout << "'human readable' timestamp: " << m_humanTimestamp << std::endl;
39  return humanTimestamp;
40 }

The documentation for this class was generated from the following files: