You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The contract for a timestamp requires that a timestamp with a negative seconds component must have a negative nanos component. As currently implemented, the nanos component will always be positive when converting from a chrono DateTime. This may cause issues with downstream consumers who expect that the nanos field will follow the behavior defined in the documentation and require a timestamp from before 1970.
For reference on how to correct this, see the implementation of From<SystemTime> in prost-types. (It would also be nice if pbjson-types included a From<SystemTime> implementation as well.)
The text was updated successfully, but these errors were encountered:
According to the spec, the nanos field is to always be positive:
Non-negative fractions of a second at nanosecond resolution. 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.
The contract for a timestamp requires that a timestamp with a negative
seconds
component must have a negativenanos
component. As currently implemented, thenanos
component will always be positive when converting from a chrono DateTime. This may cause issues with downstream consumers who expect that thenanos
field will follow the behavior defined in the documentation and require a timestamp from before 1970.For reference on how to correct this, see the implementation of
From<SystemTime>
inprost-types
. (It would also be nice ifpbjson-types
included aFrom<SystemTime>
implementation as well.)The text was updated successfully, but these errors were encountered: