26 extern const char RFC3339_full[] =
"%Y-%m-%dT%H:%M:%E*S%Ez";
27 extern const char RFC3339_sec[] =
"%Y-%m-%dT%H:%M:%S%Ez";
29 extern const char RFC1123_full[] =
"%a, %d %b %E4Y %H:%M:%S %z";
34 const char kInfiniteFutureStr[] =
"infinite-future";
35 const char kInfinitePastStr[] =
"infinite-past";
44 std::chrono::system_clock::from_time_t(0));
62 const int64_t rep_hi = (parts.sec - unix_epoch()).count();
63 const uint32_t rep_lo = parts.fem.count() / (1000 * 1000 / 4);
74 const auto parts = Split(t);
96 const char*
data = input.c_str();
97 while (std::isspace(*data)) ++
data;
99 size_t inf_size = strlen(kInfiniteFutureStr);
100 if (strncmp(data, kInfiniteFutureStr, inf_size) == 0) {
101 const char* new_data = data + inf_size;
102 while (std::isspace(*new_data)) ++new_data;
103 if (*new_data ==
'\0') {
109 inf_size = strlen(kInfinitePastStr);
110 if (strncmp(data, kInfinitePastStr, inf_size) == 0) {
111 const char* new_data = data + inf_size;
112 while (std::isspace(*new_data)) ++new_data;
113 if (*new_data ==
'\0') {
122 &parts.sec, &parts.fem, &error);
125 }
else if (err !=
nullptr) {
const char RFC1123_no_wday[]
constexpr Time InfiniteFuture()
std::string FormatTime(const std::string &format, absl::Time t, absl::TimeZone tz)
constexpr Duration ToUnixDuration(Time t)
std::string UnparseFlag(const T &v)
const char RFC3339_full[]
bool ParseTime(const std::string &format, const std::string &input, absl::Time *time, std::string *err)
std::chrono::duration< std::int_fast64_t, std::femto > femtoseconds
constexpr Time FromUnixDuration(Duration d)
std::chrono::duration< std::int_fast64_t > seconds
static char data[kDataSize]
std::string format(const std::string &, const time_point< seconds > &, const femtoseconds &, const time_zone &)
constexpr Duration MakeDuration(int64_t hi, uint32_t lo)
bool parse(const std::string &, const std::string &, const time_zone &, time_point< seconds > *, femtoseconds *, std::string *err=nullptr)
std::chrono::time_point< std::chrono::system_clock, D > time_point
constexpr uint32_t GetRepLo(Duration d)
bool ParseFlag(absl::string_view input, T *dst, std::string *error)
const char RFC1123_full[]
constexpr int64_t GetRepHi(Duration d)
constexpr Time InfinitePast()