diff options
author | Abseil Team <absl-team@google.com> | 2018-04-20T16·16-0700 |
---|---|---|
committer | Jon Cohen <cohenjon@google.com> | 2018-04-20T16·30-0400 |
commit | faf0a1b90374eab44e8956973b0e13febdcf3377 (patch) | |
tree | 63a7fd12a50b15c4a321e8373c1bbd975df0b7ba /absl/time/time.h | |
parent | 5b535401665cc6aa96d54a5c9b0901153d97210f (diff) |
- 551e205ef49682a1cb7e6e0cda46957fbcf88edd Release absl::variant. by Xiaoyi Zhang <zhangxy@google.com>
- 01c52f640594d073c6e54c47e7853b25522cf085 Update comments in absl::variant (and minor changes to ab... by Tom Manshreck <shreck@google.com> - 064465e1e6b158abd8c38fd1942b4fc464b57d6a Documentation change. by Abseil Team <absl-team@google.com> - 58df2c8a27e80c9ea21d87c1acee8019246377c9 Relocates SetCountdown and UnsetCountdown to the exceptio... by Abseil Team <absl-team@google.com> - fd9d248d0948d472f2543f7fd9c0ae4a1cd60d01 Clarify thread_annotation.h documentation around local va... by Abseil Team <absl-team@google.com> - 0d0abaf7f0945ac5f2c5f49e78afe1b326d5aca0 Typo fix in comments. by Abseil Team <absl-team@google.com> - 67286d587cbd07508a81e5b8147c245a5b5538b4 Internal change. by Xiaoyi Zhang <zhangxy@google.com> GitOrigin-RevId: 551e205ef49682a1cb7e6e0cda46957fbcf88edd Change-Id: I1a343b080187293cb5f892a309618b5712e7aa14
Diffstat (limited to 'absl/time/time.h')
-rw-r--r-- | absl/time/time.h | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/absl/time/time.h b/absl/time/time.h index daf0b1559f58..30c49d4123ed 100644 --- a/absl/time/time.h +++ b/absl/time/time.h @@ -880,7 +880,8 @@ extern const char RFC1123_no_wday[]; // %d %b %E4Y %H:%M:%S %z // provided format std::string. Uses strftime()-like formatting options, with // the following extensions: // -// - %Ez - RFC3339-compatible numeric time zone (+hh:mm or -hh:mm) +// - %Ez - RFC3339-compatible numeric UTC offset (+hh:mm or -hh:mm) +// - %E*z - Full-resolution numeric UTC offset (+hh:mm:ss or -hh:mm:ss) // - %E#S - Seconds with # digits of fractional precision // - %E*S - Seconds with full fractional precision (a literal '*') // - %E#f - Fractional seconds with # digits of precision @@ -894,8 +895,8 @@ extern const char RFC1123_no_wday[]; // %d %b %E4Y %H:%M:%S %z // year. A year outside of [-999:9999] when formatted with %E4Y will produce // more than four characters, just like %Y. // -// We recommend that format strings include %Ez so that the result uniquely -// identifies a time instant. +// We recommend that format strings include the UTC offset (%z, %Ez, or %E*z) +// so that the result uniquely identifies a time instant. // // Example: // @@ -929,7 +930,8 @@ inline std::ostream& operator<<(std::ostream& os, Time t) { // Parses an input std::string according to the provided format std::string and // returns the corresponding `absl::Time`. Uses strftime()-like formatting // options, with the same extensions as FormatTime(), but with the -// exceptions that %E#S is interpreted as %E*S, and %E#f as %E*f. +// exceptions that %E#S is interpreted as %E*S, and %E#f as %E*f. %Ez +// and %E*z also accept the same inputs. // // %Y consumes as many numeric characters as it can, so the matching data // should always be terminated with a non-numeric. %E4Y always consumes @@ -940,10 +942,11 @@ inline std::ostream& operator<<(std::ostream& os, Time t) { // "1970-01-01 00:00:00.0 +0000" // // For example, parsing a std::string of "15:45" (%H:%M) will return an absl::Time -// that represents "1970-01-01 15:45:00.0 +0000". Note: Since ParseTime() -// returns time instants, it makes the most sense to parse fully-specified -// date/time strings that include a UTC offset (%z/%Ez), such as those -// matching RFC3339_full above. +// that represents "1970-01-01 15:45:00.0 +0000". +// +// Note that since ParseTime() returns time instants, it makes the most sense +// to parse fully-specified date/time strings that include a UTC offset (%z, +// %Ez, or %E*z). // // Note also that `absl::ParseTime()` only heeds the fields year, month, day, // hour, minute, (fractional) second, and UTC offset. Other fields, like @@ -974,8 +977,8 @@ bool ParseTime(const std::string& format, const std::string& input, Time* time, std::string* err); // Like ParseTime() above, but if the format std::string does not contain a UTC -// offset specification (%z/%Ez) then the input is interpreted in the given -// TimeZone. This means that the input, by itself, does not identify a +// offset specification (%z/%Ez/%E*z) then the input is interpreted in the +// given TimeZone. This means that the input, by itself, does not identify a // unique instant. Being time-zone dependent, it also admits the possibility // of ambiguity or non-existence, in which case the "pre" time (as defined // for ConvertDateTime()) is returned. For these reasons we recommend that |