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
17
18eformat::helper::DateAndTime::DateAndTime( uint32_t val ) : m_val( val ) {}
19
20std::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
29std::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}
Double_t time
std::string iso8601(void) const
std::string human(void) const
int t()
Definition t.c:1