MCPcopy
hub / github.com/danielgtaylor/python-betterproto / delta_to_json

Method delta_to_json

src/betterproto/__init__.py:1958–1963  ·  view source on GitHub ↗
(delta: timedelta)

Source from the content-addressed store, hash-verified

1956
1957 @staticmethod
1958 def delta_to_json(delta: timedelta) -> str:
1959 parts = str(delta.total_seconds()).split(".")
1960 if len(parts) > 1:
1961 while len(parts[1]) not in (3, 6, 9):
1962 parts[1] = f"{parts[1]}0"
1963 return f"{'.'.join(parts)}s"
1964
1965
1966class _Timestamp(Timestamp):

Callers 1

to_dictMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected