#include <google/protobuf/stubs/time.h>
#include <ctime>
#include <google/protobuf/stubs/stringprintf.h>
#include <google/protobuf/stubs/strutil.h>
namespace google {
namespace protobuf {
namespace internal {
namespace {
static const int64_t kSecondsPerMinute = …;
static const int64_t kSecondsPerHour = …;
static const int64_t kSecondsPerDay = …;
static const int64_t kSecondsPer400Years = …;
static const int64_t kSecondsFromEraToEpoch = …;
static const int64_t kMinTime = …;
static const int64_t kMaxTime = …;
static const int kNanosPerMillisecond = …;
static const int kNanosPerMicrosecond = …;
int64_t SecondsPer100Years(int year) { … }
int64_t SecondsPer4Years(int year) { … }
bool IsLeapYear(int year) { … }
int64_t SecondsPerYear(int year) { … }
static const int kDaysInMonth[13] = …;
int64_t SecondsPerMonth(int month, bool leap) { … }
static const int kDaysSinceJan[13] = …;
bool ValidateDateTime(const DateTime& time) { … }
int64_t SecondsSinceCommonEra(const DateTime& time) { … }
std::string FormatNanos(int32_t nanos) { … }
const char* ParseInt(const char* data, int width, int min_value,
int max_value, int* result) { … }
const char* ParseNanos(const char* data, int32_t* nanos) { … }
const char* ParseTimezoneOffset(const char* data, int64_t* offset) { … }
}
bool SecondsToDateTime(int64_t seconds, DateTime* time) { … }
bool DateTimeToSeconds(const DateTime& time, int64_t* seconds) { … }
void GetCurrentTime(int64_t* seconds, int32_t* nanos) { … }
std::string FormatTime(int64_t seconds, int32_t nanos) { … }
bool ParseTime(const std::string& value, int64_t* seconds, int32_t* nanos) { … }
}
}
}