diff options
author | TeBoring <teboring@google.com> | 2015-08-26 14:02:44 -0700 |
---|---|---|
committer | TeBoring <teboring@google.com> | 2015-08-26 16:24:06 -0700 |
commit | aca5a60883385db08f234e43d1f1b2f5867f92e5 (patch) | |
tree | 0e6e071a53e14d8a8db6440ef7cffae480d29a26 /objectivec/google/protobuf/Timestamp.pbobjc.h | |
parent | b1b98e4b79592baddb5ce1473f53d984a18478da (diff) |
Fix bugs for objectivec
Diffstat (limited to 'objectivec/google/protobuf/Timestamp.pbobjc.h')
-rw-r--r-- | objectivec/google/protobuf/Timestamp.pbobjc.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/objectivec/google/protobuf/Timestamp.pbobjc.h b/objectivec/google/protobuf/Timestamp.pbobjc.h index 0b342156..a1f68bd2 100644 --- a/objectivec/google/protobuf/Timestamp.pbobjc.h +++ b/objectivec/google/protobuf/Timestamp.pbobjc.h @@ -77,11 +77,12 @@ typedef GPB_ENUM(GPBTimestamp_FieldNumber) { // 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) @interface GPBTimestamp : GPBMessage |