Common Unix-epoch timestamp wire representation. More...
Classes | |
| class | Timestamp |
| Decoded OpenRoadCode wire timestamp. More... | |
Functions | |
| None | validate_timestamp (Mapping[str, Any] payload) |
| Validate the common timestamp wire contract. | |
| Timestamp | decode_timestamp (Mapping[str, Any] payload) |
| Validate and decode a common wire timestamp. | |
| dict[str, int] | encode_timestamp (datetime timestamp) |
| Encode a datetime as unsigned Unix epoch seconds plus nanoseconds. | |
Common Unix-epoch timestamp wire representation.
| dict[str, int] messaging.contracts.common.timestamp.encode_timestamp | ( | datetime | timestamp | ) |
Encode a datetime as unsigned Unix epoch seconds plus nanoseconds.
Wire contract:
Naive datetimes are interpreted as UTC. Python's datetime has microsecond resolution, so nanoseconds produced from a datetime are currently multiples of 1,000. The wire contract intentionally preserves nanosecond capacity for future higher-resolution sources.