aboutsummaryrefslogtreecommitdiffhomepage
path: root/objectivec/GPBWellKnownTypes.m
diff options
context:
space:
mode:
authorGravatar Thomas Van Lenten <thomasvl@google.com>2017-01-12 16:00:13 -0500
committerGravatar GitHub <noreply@github.com>2017-01-12 16:00:13 -0500
commit16513425019cf396d952f0df454a26f2fa26c1ba (patch)
treed2703a613c8ce4a580e4e517577184b501bccbc1 /objectivec/GPBWellKnownTypes.m
parentcf477d46ca8a837bc92e591617f283d9fa1ace5c (diff)
Revert "Fix Timestamps with dates before the Unix epoch that contain fractional seconds."
Diffstat (limited to 'objectivec/GPBWellKnownTypes.m')
-rw-r--r--objectivec/GPBWellKnownTypes.m9
1 files changed, 0 insertions, 9 deletions
diff --git a/objectivec/GPBWellKnownTypes.m b/objectivec/GPBWellKnownTypes.m
index 83b1c833..ed798a2e 100644
--- a/objectivec/GPBWellKnownTypes.m
+++ b/objectivec/GPBWellKnownTypes.m
@@ -50,15 +50,6 @@ static int32_t SecondsAndNanosFromTimeIntervalSince1970(NSTimeInterval time,
int64_t *outSeconds) {
NSTimeInterval seconds;
NSTimeInterval nanos = modf(time, &seconds);
-
- // Per Timestamp.proto, nanos is non-negative and "Negative second values with
- // fractions must still have non-negative nanos values that count forward in
- // time. Must be from 0 to 999,999,999 inclusive."
- if (nanos < 0) {
- --seconds;
- nanos = 1.0 + nanos;
- }
-
nanos *= 1e9;
*outSeconds = (int64_t)seconds;
return (int32_t)nanos;