BOSS 7.0.5
BESIII Offline Software System
Loading...
Searching...
No Matches
eformat::helper::DateAndTime Class Reference

#include <DateAndTime.h>

Public Member Functions

 DateAndTime ()
 
 DateAndTime (uint32_t val)
 
uint32_t code (void) const
 
std::string iso8601 (void) const
 
std::string human (void) const
 
 DateAndTime ()
 
 DateAndTime (uint32_t val)
 
uint32_t code (void) const
 
std::string iso8601 (void) const
 
std::string human (void) const
 

Detailed Description

Interprets and composes a date and time field (32-bit unsigned integer)

Definition at line 26 of file Event/eformat/eformat-00-00-04/eformat/DateAndTime.h.

Constructor & Destructor Documentation

◆ DateAndTime() [1/4]

eformat::helper::DateAndTime::DateAndTime ( )

Default constructor, it means, now

Definition at line 16 of file DateAndTime.cxx.

17 : m_val(time(0))
18{
19}
Double_t time

◆ DateAndTime() [2/4]

eformat::helper::DateAndTime::DateAndTime ( uint32_t  val)

Build from an existing date in time

Parameters
valThe value of the compiled date and time field

Definition at line 21 of file DateAndTime.cxx.

22 : m_val(val)
23{
24}

◆ DateAndTime() [3/4]

eformat::helper::DateAndTime::DateAndTime ( )

Default constructor, it means, now

◆ DateAndTime() [4/4]

eformat::helper::DateAndTime::DateAndTime ( uint32_t  val)

Build from an existing date in time

Parameters
valThe value of the compiled date and time field

Member Function Documentation

◆ code() [1/2]

uint32_t eformat::helper::DateAndTime::code ( void  ) const
inline

Get the current representation

Definition at line 45 of file Event/eformat/eformat-00-00-04/eformat/DateAndTime.h.

45{ return m_val; }

◆ code() [2/2]

uint32_t eformat::helper::DateAndTime::code ( void  ) const
inline

Get the current representation

Definition at line 45 of file InstallArea/include/eformat/eformat/DateAndTime.h.

45{ return m_val; }

◆ human() [1/2]

std::string eformat::helper::DateAndTime::human ( void  ) const

Returns a string that represents the time in a human readable format

Definition at line 36 of file DateAndTime.cxx.

37{
38 struct tm t;
39 time_t val = code();
40 gmtime_r(&val, &t);
41 char buf[100];
42 strftime(buf, 100, "%a, %d %b %Y %H:%M:%S UTC", &t);
43 return buf;
44}
TTree * t
Definition: binning.cxx:23

◆ human() [2/2]

std::string eformat::helper::DateAndTime::human ( void  ) const

Returns a string that represents the time in a human readable format

◆ iso8601() [1/2]

std::string eformat::helper::DateAndTime::iso8601 ( void  ) const

Returns a string that represents the time in ISO8601

Definition at line 26 of file DateAndTime.cxx.

27{
28 struct tm t;
29 time_t val = code();
30 gmtime_r(&val, &t);
31 char buf[100];
32 strftime(buf, 100, "%Y-%m-%dT%H:%M:%SZ", &t);
33 return buf;
34}

◆ iso8601() [2/2]

std::string eformat::helper::DateAndTime::iso8601 ( void  ) const

Returns a string that represents the time in ISO8601


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