BOSS
8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
DateAndTime.cxx
Go to the documentation of this file.
1
// Dear emacs, this is -*- c++ -*-
2
3
/**
4
* @file DateAndTime.cxx
5
* @author <a href="mailto:Andre.dos.Anjos@cern.ch">Andre DOS ANJOS</a>
6
* $Author: zhangy $
7
* $Revision: 1.1.1.1 $
8
* $Date: 2009/06/19 07:35:41 $
9
*
10
* Implements date and time interpretation
11
*/
12
13
#include "eformat/DateAndTime.h"
14
#include <ctime>
15
16
eformat::helper::DateAndTime::DateAndTime
() : m_val(
time
( 0 ) ) {}
17
18
eformat::helper::DateAndTime::DateAndTime
( uint32_t val ) : m_val( val ) {}
19
20
std::string
eformat::helper::DateAndTime::iso8601
(
void
)
const
{
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
}
28
29
std::string
eformat::helper::DateAndTime::human
(
void
)
const
{
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
}
time
Double_t time
Definition
DataBase/tau_mode.c:7
eformat::helper::DateAndTime::iso8601
std::string iso8601(void) const
Definition
DateAndTime.cxx:20
eformat::helper::DateAndTime::code
uint32_t code(void) const
Definition
Event/eformat/include/eformat/DateAndTime.h:44
eformat::helper::DateAndTime::DateAndTime
DateAndTime()
Definition
DateAndTime.cxx:16
eformat::helper::DateAndTime::human
std::string human(void) const
Definition
DateAndTime.cxx:29
t
int t()
Definition
t.c:1
8.0.0
BOSS_Source
Event
eformat
src
DateAndTime.cxx
Generated by
1.16.1