6 #include <glog/logging.h>
12 auto sec() const { return tv_
.tv_sec
; }
13 auto usec() const { return tv_
.tv_usec
; }
14 const char* c_str() const { return c_str_
; }
18 char c_str_
[32]; // RFC 5322 date-time section 3.3.
20 friend std::ostream
& operator<<(std::ostream
& s
, Now
const& now
)
22 return s
<< now
.c_str_
;
28 PCHECK(gettimeofday(&tv_
, nullptr) == 0);
29 tm
* ptm
= CHECK_NOTNULL(localtime(&tv_
.tv_sec
));
30 CHECK_EQ(strftime(c_str_
, sizeof c_str_
, "%a, %d %b %Y %H:%M:%S %z", ptm
),