#include <DateAndTime.h>
Public Member Functions | |
DateAndTime () | |
DateAndTime (uint32_t val) | |
uint32_t | code (void) const |
std::string | iso8601 (void) const |
std::string | human (void) const |
Private Attributes | |
uint32_t | m_val |
my current value |
Definition at line 26 of file DateAndTime.h.
eformat::helper::DateAndTime::DateAndTime | ( | ) |
Default constructor, it means, now
Definition at line 16 of file DateAndTime.cxx.
00017 : m_val(time(0)) 00018 { 00019 }
eformat::helper::DateAndTime::DateAndTime | ( | uint32_t | val | ) |
Build from an existing date in time
val | The value of the compiled date and time field |
Definition at line 21 of file DateAndTime.cxx.
00022 : m_val(val) 00023 { 00024 }
uint32_t eformat::helper::DateAndTime::code | ( | void | ) | const [inline] |
std::string eformat::helper::DateAndTime::human | ( | void | ) | const |
Returns a string that represents the time in a human readable format
Definition at line 36 of file DateAndTime.cxx.
References code().
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 }
std::string eformat::helper::DateAndTime::iso8601 | ( | void | ) | const |
Returns a string that represents the time in ISO8601
Definition at line 26 of file DateAndTime.cxx.
References code().
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 }
uint32_t eformat::helper::DateAndTime::m_val [private] |