MCPcopy Index your code
hub / github.com/apache/fory / write

Method write

python/pyfory/_serializer.py:446–451  ·  view source on GitHub ↗
(self, write_context, value: datetime.datetime)

Source from the content-addressed store, hash-verified

444 return seconds, nanos
445
446 def write(self, write_context, value: datetime.datetime):
447 if not isinstance(value, datetime.datetime):
448 raise TypeError("{} should be {} instead of {}".format(value, datetime, type(value)))
449 seconds, nanos = self._get_timestamp(value)
450 write_context.write_int64(seconds)
451 write_context.write_uint32(nanos)
452
453 def read(self, read_context):
454 seconds = read_context.read_int64()

Callers

nothing calls this directly

Calls 4

_get_timestampMethod · 0.95
formatMethod · 0.45
write_int64Method · 0.45
write_uint32Method · 0.45

Tested by

no test coverage detected