BOSS 8.0.0
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
 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/include/eformat/DateAndTime.h.

Constructor & Destructor Documentation

◆ DateAndTime() [1/6]

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

Default constructor, it means, now

Definition at line 16 of file DateAndTime.cxx.

16: m_val( time( 0 ) ) {}
Double_t time

◆ DateAndTime() [2/6]

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 18 of file DateAndTime.cxx.

18: m_val( val ) {}

◆ DateAndTime() [3/6]

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

Default constructor, it means, now

◆ DateAndTime() [4/6]

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

Build from an existing date in time

Parameters
valThe value of the compiled date and time field

◆ DateAndTime() [5/6]

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

Default constructor, it means, now

◆ DateAndTime() [6/6]

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/3]

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

Get the current representation

Definition at line 44 of file Event/eformat/include/eformat/DateAndTime.h.

44{ return m_val; }

Referenced by human(), and iso8601().

◆ code() [2/3]

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

Get the current representation

Definition at line 44 of file InstallArea/x86_64-el9-gcc13-dbg/include/eformat/DateAndTime.h.

44{ return m_val; }

◆ code() [3/3]

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

Get the current representation

Definition at line 44 of file InstallArea/x86_64-el9-gcc13-opt/include/eformat/DateAndTime.h.

44{ return m_val; }

◆ human() [1/3]

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

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

Definition at line 29 of file DateAndTime.cxx.

29 {
30 struct tm t;
31 time_t val = code();
32 gmtime_r( &val, &t );
33 char buf[100];
34 strftime( buf, 100, "%a, %d %b %Y %H:%M:%S UTC", &t );
35 return buf;
36}
int t()
Definition t.c:1

◆ human() [2/3]

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

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

◆ human() [3/3]

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

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

◆ iso8601() [1/3]

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

Returns a string that represents the time in ISO8601

Definition at line 20 of file DateAndTime.cxx.

20 {
21 struct tm t;
22 time_t val = code();
23 gmtime_r( &val, &t );
24 char buf[100];
25 strftime( buf, 100, "%Y-%m-%dT%H:%M:%SZ", &t );
26 return buf;
27}

◆ iso8601() [2/3]

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

Returns a string that represents the time in ISO8601

◆ iso8601() [3/3]

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: