We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4387c90 commit 777410aCopy full SHA for 777410a
asynctnt/iproto/ext.pyx
@@ -187,6 +187,10 @@ cdef void datetime_from_py(datetime ob, IProtoDateTime *dt):
187
ts = <double> ob.timestamp()
188
dt.seconds = <int64_t> ts
189
dt.nsec = <int32_t> ((ts - <double> dt.seconds) * 1000000) * 1000
190
+ if dt.nsec < 0:
191
+ # correction for negative dates
192
+ dt.seconds -= 1
193
+ dt.nsec += 1000000000
194
195
if datetime_tzinfo(ob) is not None:
196
offset = ob.utcoffset().total_seconds()
0 commit comments