28 inline void time_t_to_String(time_t t,
char *buf) {
34 buf[ strlen( buf ) - 1 ] = 0;
37 inline string time_t_to_String(time_t t = time(0) ) {
40 ctime_s(buf,
sizeof(buf), &t);
44 buf[ strlen( buf ) - 1 ] = 0;
48 inline string time_t_to_String_no_year(time_t t) {
51 ctime_s(buf,
sizeof(buf), &t);
59 inline string time_t_to_String_short(time_t t) {
62 ctime_s(buf,
sizeof(buf), &t);
67 if( buf[0] && buf[1] && buf[2] && buf[3] )
75 Date_t(
long long m): millis(m) {}
76 operator long long&() {
return millis; }
77 operator const long long&()
const {
return millis; }
78 string toString()
const {
80 time_t_to_String(millis/1000, buf);
87 inline int strnlen(
const char *s,
int n ) {
88 for(
int i = 0; i < n; ++i )