Home | History | Annotate | Download | only in util

Lines Matching refs:Timestamp

44 #include <google/protobuf/timestamp.pb.h>
51 typedef google::protobuf::Timestamp Timestamp;
55 // The min/max Timestamp/Duration values we support.
64 // Converts Timestamp to/from RFC 3339 date string format.
69 // Note that Timestamp can only represent time from
71 // a Timestamp outside of this range is undefined behavior.
79 static string ToString(const Timestamp& timestamp);
80 static bool FromString(const string& value, Timestamp* timestamp);
89 static bool FromString(const string& value, Duration* timestamp);
95 static Timestamp GetCurrentTime();
97 static Timestamp GetEpoch();
120 // Creates Timestamp from integer types. The integer value indicates the
122 // value is not in the valid range of Timestamp.
123 static Timestamp NanosecondsToTimestamp(int64 nanos);
124 static Timestamp MicrosecondsToTimestamp(int64 micros);
125 static Timestamp MillisecondsToTimestamp(int64 millis);
126 static Timestamp SecondsToTimestamp(int64 seconds);
130 // Timestamp is not valid (i.e., its seconds part or nanos part does not fall
132 static int64 TimestampToNanoseconds(const Timestamp& timestamp);
133 static int64 TimestampToMicroseconds(const Timestamp& timestamp);
134 static int64 TimestampToMilliseconds(const Timestamp& timestamp);
135 static int64 TimestampToSeconds(const Timestamp& timestamp);
138 // have a different precision and time range from Timestamp/Duration.
144 static Timestamp TimeTToTimestamp(time_t value);
145 static time_t TimestampToTimeT(const Timestamp& value);
148 static Timestamp TimevalToTimestamp(const timeval& value);
149 static timeval TimestampToTimeval(const Timestamp& value);
242 // Overloaded operators for Timestamp
245 LIBPROTOBUF_EXPORT Timestamp& operator+=(Timestamp& t, const Duration& d); // NOLINT
246 LIBPROTOBUF_EXPORT Timestamp& operator-=(Timestamp& t, const Duration& d); // NOLINT
248 inline bool operator<(const Timestamp& t1, const Timestamp& t2) {
254 inline bool operator>(const Timestamp& t1, const Timestamp& t2) {
257 inline bool operator>=(const Timestamp& t1, const Timestamp& t2) {
260 inline bool operator<=(const Timestamp& t1, const Timestamp& t2) {
263 inline bool operator==(const Timestamp& t1, const Timestamp& t2) {
266 inline bool operator!=(const Timestamp& t1, const Timestamp& t2) {
270 inline Timestamp operator+(const Timestamp& t, const Duration& d) {
271 Timestamp result = t;
274 inline Timestamp operator+(const Duration& d, const Timestamp& t) {
275 Timestamp result = t;
278 inline Timestamp operator-(const Timestamp& t, const Duration& d) {
279 Timestamp result = t;
282 LIBPROTOBUF_EXPORT Duration operator-(const Timestamp& t1, const Timestamp& t2);
284 inline ostream& operator<<(ostream& out, const Timestamp& t) {