Lines Matching +full:- +full:- +full:duration +full:- +full:seconds
2 // source: google/protobuf/duration.proto
18 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
24 #pragma mark - GPBDurationRoot
39 #pragma mark - GPBDuration
47 * A Duration represents a signed, fixed-length span of time represented
48 * as a count of seconds and fractions of seconds at nanosecond
51 * two Timestamp values is a Duration and it can be added or subtracted
52 * from a Timestamp. Range is approximately +-10,000 years.
56 * Example 1: Compute Duration from two Timestamps in pseudo code.
60 * Duration duration = ...;
62 * duration.seconds = end.seconds - start.seconds;
63 * duration.nanos = end.nanos - start.nanos;
65 * if (duration.seconds < 0 && duration.nanos > 0) {
66 * duration.seconds += 1;
67 * duration.nanos -= 1000000000;
68 * } else if (duration.seconds > 0 && duration.nanos < 0) {
69 * duration.seconds -= 1;
70 * duration.nanos += 1000000000;
73 * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
76 * Duration duration = ...;
79 * end.seconds = start.seconds + duration.seconds;
80 * end.nanos = start.nanos + duration.nanos;
83 * end.seconds -= 1;
86 * end.seconds += 1;
87 * end.nanos -= 1000000000;
90 * Example 3: Compute Duration from datetime.timedelta in Python.
93 * duration = Duration()
94 * duration.FromTimedelta(td)
98 * In JSON format, the Duration type is encoded as a string rather than an
99 * object, where the string ends in the suffix "s" (indicating seconds) and
100 * is preceded by the number of seconds, with nanoseconds expressed as
101 * fractional seconds. For example, 3 seconds with 0 nanoseconds should be
102 * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
103 * be expressed in JSON format as "3.000000001s", and 3 seconds and 1
109 * Signed seconds of the span of time. Must be from -315,576,000,000
113 @property(nonatomic, readwrite) int64_t seconds;
118 * `seconds` field and a positive or negative `nanos` field. For durations
119 * of one second or more, a non-zero value for the `nanos` field must be
120 * of the same sign as the `seconds` field. Must be from -999,999,999