BOSS
7.1.1
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:
[email protected]
">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
()
17
: m_val(
time
(0))
18
{
19
}
20
21
eformat::helper::DateAndTime::DateAndTime
(uint32_t val)
22
: m_val(val)
23
{
24
}
25
26
std::string
eformat::helper::DateAndTime::iso8601
(
void
)
const
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
}
35
36
std::string
eformat::helper::DateAndTime::human
(
void
)
const
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
}
time
Double_t time
Definition
DataBase/tau_mode.c:7
DateAndTime.h
Describes how to create and interpret a date and time field.
t
TTree * t
Definition
binning.cxx:23
eformat::helper::DateAndTime::iso8601
std::string iso8601(void) const
Definition
DateAndTime.cxx:26
eformat::helper::DateAndTime::DateAndTime
DateAndTime()
Definition
DateAndTime.cxx:16
eformat::helper::DateAndTime::human
std::string human(void) const
Definition
DateAndTime.cxx:36
7.1.1
Event
eformat
eformat-00-01-00
src
DateAndTime.cxx
Generated by
1.12.0