|
Click
|
The Timestamp class represents a moment or interval in time. More...
Go to the source code of this file.
Classes | |
| class | Timestamp |
| Represents a moment or interval in time. More... | |
| union | Timestamp::rep_t |
| Type of a Timestamp representation. More... | |
| class | TimestampArg |
| Parser class for timestamps. More... | |
Functions | |
| Timestamp | operator+ (Timestamp a, const Timestamp &b) |
| Add the two operands and return the result. | |
| bool | operator< (const Timestamp &a, int b) |
| bool | operator<= (const Timestamp &a, int b) |
| bool | operator>= (const Timestamp &a, int b) |
| bool | operator> (const Timestamp &a, int b) |
| Timestamp & | operator+= (Timestamp &a, const Timestamp &b) |
| Add b to a. | |
| Timestamp & | operator-= (Timestamp &a, const Timestamp &b) |
| Subtract b from a. | |
| Timestamp | operator- (Timestamp a, const Timestamp &b) |
| Subtract b from a and return the result. | |
| Timestamp | operator- (const Timestamp &a) |
| Negate a and return the result. | |
| Timestamp | operator* (const Timestamp &a, double b) |
| Scale a by a factor of b and return the result. | |
| Timestamp | operator* (const Timestamp &a, int b) |
| Timestamp | operator* (const Timestamp &a, unsigned b) |
| Timestamp | operator* (double a, const Timestamp &b) |
| Timestamp | operator* (int a, const Timestamp &b) |
| Timestamp | operator* (unsigned a, const Timestamp &b) |
| Timestamp | operator/ (const Timestamp &a, double b) |
| Scale a down by a factor of b and return the result. | |
| Timestamp | operator/ (const Timestamp &a, int b) |
| Timestamp | operator/ (const Timestamp &a, unsigned b) |
| double | operator/ (const Timestamp &a, const Timestamp &b) |
| Divide a by b and return the result. | |
| StringAccum & | operator<< (StringAccum &, const Timestamp &) |
| bool | cp_time (const String &str, Timestamp *result, bool allow_negative) |
| Parse a timestamp from str. | |
Variables | |
| const ArgContext | blank_args |
The Timestamp class represents a moment or interval in time.
Add the two operands and return the result.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Add b to a.
Returns the result (the new value of a).
Subtract b from a.
Returns the result (the new value of a).
Subtract b from a and return the result.
Scale a by a factor of b and return the result.
Scale a down by a factor of b and return the result.
Divide a by b and return the result.
Parse a timestamp from str.
| str | string | |
| [out] | result | stores parsed result |
| allow_negative | allow negative timestamps if true |
Parses a timestamp from str. Timestamps are expressed as fractional amounts of seconds, usually measured in Unix time, such as "1189383079.180265331". The input format accepts the unit suffixes described at cp_seconds_as. If the string fully parses, then the resulting value is stored in *result and the function returns true. Otherwise, *result remains unchanged and the function returns false.
If a number is too large for result, then the maximum possible value is stored in result and the cp_errno variable is set to CPE_OVERFLOW; otherwise, cp_errno is set to CPE_FORMAT (unparsable) or CPE_OK (if all was well).
An overloaded version of this function is available for struct timeval result values.