diff options
author | Jisi Liu <jisi.liu@gmail.com> | 2015-08-21 11:18:45 -0700 |
---|---|---|
committer | Jisi Liu <jisi.liu@gmail.com> | 2015-08-21 11:18:45 -0700 |
commit | b0f661181d10bddc08e380992590a1cdd92be92b (patch) | |
tree | d9291cf324a72206ae3e474fe49186e8c96b2a9e /src/google/protobuf/timestamp.proto | |
parent | d119a275495b7dcc9c389c9c650ebd83de265511 (diff) | |
download | protobuf-b0f661181d10bddc08e380992590a1cdd92be92b.tar.gz protobuf-b0f661181d10bddc08e380992590a1cdd92be92b.tar.bz2 protobuf-b0f661181d10bddc08e380992590a1cdd92be92b.zip |
Down-integrate from internal branch.
Change-Id: Ieb7a2c2fbf35bc2a8fa65b915a5ecb68c83863e4
Diffstat (limited to 'src/google/protobuf/timestamp.proto')
-rw-r--r-- | src/google/protobuf/timestamp.proto | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/google/protobuf/timestamp.proto b/src/google/protobuf/timestamp.proto index 381ff997..ac2a4825 100644 --- a/src/google/protobuf/timestamp.proto +++ b/src/google/protobuf/timestamp.proto @@ -38,7 +38,6 @@ option java_package = "com.google.protobuf"; option csharp_namespace = "Google.ProtocolBuffers"; option objc_class_prefix = "GPB"; - // A Timestamp represents a point in time independent of any time zone // or calendar, represented as seconds and fractions of seconds at // nanosecond resolution in UTC Epoch time. It is encoded using the @@ -85,14 +84,16 @@ option objc_class_prefix = "GPB"; // Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) // .setNanos((int) ((millis % 1000) * 1000000)).build(); // -// Example 5: Compute Timestamp from Python `datetime.datetime`. // -// now = datetime.datetime.utcnow() -// seconds = int(time.mktime(now.timetuple())) -// nanos = now.microsecond * 1000 +// Example 5: Compute Timestamp from current time in Python. +// +// now = time.time() +// seconds = int(now) +// nanos = int((now - seconds) * 10**9) // timestamp = Timestamp(seconds=seconds, nanos=nanos) // message Timestamp { + // Represents seconds of UTC time since Unix epoch // 1970-01-01T00:00:00Z. Must be from from 0001-01-01T00:00:00Z to // 9999-12-31T23:59:59Z inclusive. |