summaryrefslogtreecommitdiff
path: root/absl
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2023-04-04 20:04:31 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2023-04-04 20:05:40 -0700
commitd7228036ab2a191462c532b914a99c3a8d10a171 (patch)
treeaa8e5c1ae34630088adc3a94f8be286689de4c08 /absl
parentdc51d35fe719b3a3c49f895c149b0920a3745cc4 (diff)
Add commentary for universal time scale
PiperOrigin-RevId: 521932692 Change-Id: If637de6501a4ac41f0078d581049d23aad3480a4
Diffstat (limited to 'absl')
-rw-r--r--absl/time/time.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/absl/time/time.h b/absl/time/time.h
index 89b1b2af..f255593e 100644
--- a/absl/time/time.h
+++ b/absl/time/time.h
@@ -850,7 +850,8 @@ ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Time InfinitePast() {
// FromUDate()
// FromUniversal()
//
-// Creates an `absl::Time` from a variety of other representations.
+// Creates an `absl::Time` from a variety of other representations. See
+// https://unicode-org.github.io/icu/userguide/datetime/universaltimescale.html
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Time FromUnixNanos(int64_t ns);
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Time FromUnixMicros(int64_t us);
ABSL_ATTRIBUTE_CONST_FUNCTION constexpr Time FromUnixMillis(int64_t ms);
@@ -867,10 +868,12 @@ ABSL_ATTRIBUTE_CONST_FUNCTION Time FromUniversal(int64_t universal);
// ToUDate()
// ToUniversal()
//
-// Converts an `absl::Time` to a variety of other representations. Note that
-// these operations round down toward negative infinity where necessary to
-// adjust to the resolution of the result type. Beware of possible time_t
-// over/underflow in ToTime{T,val,spec}() on 32-bit platforms.
+// Converts an `absl::Time` to a variety of other representations. See
+// https://unicode-org.github.io/icu/userguide/datetime/universaltimescale.html
+//
+// Note that these operations round down toward negative infinity where
+// necessary to adjust to the resolution of the result type. Beware of
+// possible time_t over/underflow in ToTime{T,val,spec}() on 32-bit platforms.
ABSL_ATTRIBUTE_CONST_FUNCTION int64_t ToUnixNanos(Time t);
ABSL_ATTRIBUTE_CONST_FUNCTION int64_t ToUnixMicros(Time t);
ABSL_ATTRIBUTE_CONST_FUNCTION int64_t ToUnixMillis(Time t);