1 #ifndef Protium_Time_h_
2 #define Protium_Time_h_
53 fTM.tm_wday = weekday;
54 fTM.tm_isdst = dst? 1 : 0;
64 this->
fTM = *std::localtime( &t );
70 std::string
AsFormat(
const std::string& frmt =
"%d/%m/%Y %H:%M:%S"){
73 const char* format = frmt.c_str();
74 strftime(buffer, 80, format, &
fTM);
76 return std::string(buffer);
82 const char* time_as_string = t.c_str();
83 const char* format = fmt.c_str();
84 strptime(time_as_string, format, &tm.
fTM);
94 #endif //File Guardian
time_t GetTimeLocal() const
TimePrimitive(const time_t &t)
void SetTime(const time_t &t)
static TimePrimitive Now()
TimePrimitive & operator-=(const TimePrimitive &other)
Sequence< int, IntType< 0 >, IntType< 0 >, IntType< 1 >, IntType< 0 >, IntType< 0 >, IntType< 0 >, IntType< 0 > >::Type time
TimeDate(const TimePrimitive &other)
TimePrimitive(const TimePrimitive &t)
TimeDate(const int &sec=0, const int &min=0, const int &hour=0, const int &day=0, const int &month=0, const int &year=0, const int &weekday=0, const bool &dst=false)
std::string AsFormat(const std::string &frmt="%d/%m/%Y %H:%M:%S")
TimeDate(const TimeDate &other)
TimePrimitive & operator=(const TimePrimitive &other)
static TimeDate FromFormat(const std::string &t, const std::string &fmt="%d/%m/%Y %H:%M:%S")