BOSS 7.0.6
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
17 : m_val(time(0))
18{
19}
20
22 : m_val(val)
23{
24}
25
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
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}
Describes how to create and interpret a date and time field.
TTree * t
Definition: binning.cxx:23
std::string iso8601(void) const
Definition: DateAndTime.cxx:26
std::string human(void) const
Definition: DateAndTime.cxx:36