/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Event/eformat/eformat-00-00-04/src/DateAndTime.cxx

Go to the documentation of this file.
00001 //Dear emacs, this is -*- c++ -*-
00002 
00013 #include "eformat/DateAndTime.h"
00014 #include <ctime>
00015 
00016 eformat::helper::DateAndTime::DateAndTime ()
00017   : m_val(time(0))
00018 {
00019 }
00020 
00021 eformat::helper::DateAndTime::DateAndTime (uint32_t val)
00022   : m_val(val)
00023 {
00024 }
00025 
00026 std::string eformat::helper::DateAndTime::iso8601 (void) const
00027 {
00028   struct tm t;
00029   time_t val = code();
00030   gmtime_r(&val, &t);
00031   char buf[100];
00032   strftime(buf, 100, "%Y-%m-%dT%H:%M:%SZ", &t);
00033   return buf;
00034 }
00035 
00036 std::string eformat::helper::DateAndTime::human (void) const
00037 {
00038   struct tm t;
00039   time_t val = code();
00040   gmtime_r(&val, &t);
00041   char buf[100];
00042   strftime(buf, 100, "%a, %d %b %Y %H:%M:%S UTC", &t);
00043   return buf;
00044 }

Generated on Tue Nov 29 22:58:25 2016 for BOSS_7.0.2 by  doxygen 1.4.7