MCPcopy Index your code
hub / github.com/kubernetes-client/python / __deserialize_datetime

Method __deserialize_datetime

kubernetes/client/api_client.py:649–668  ·  view source on GitHub ↗

Deserializes string to datetime. The string should be in iso8601 datetime format. :param string: str. :return: datetime.

(self, string)

Source from the content-addressed store, hash-verified

647 )
648
649 def __deserialize_datetime(self, string):
650 """Deserializes string to datetime.
651
652 The string should be in iso8601 datetime format.
653
654 :param string: str.
655 :return: datetime.
656 """
657 try:
658 return parse(string)
659 except ImportError:
660 return string
661 except ValueError:
662 raise rest.ApiException(
663 status=0,
664 reason=(
665 "Failed to parse `{0}` as datetime object"
666 .format(string)
667 )
668 )
669
670 def __deserialize_model(self, data, klass):
671 """Deserializes list or dict to model.

Callers 1

__deserializeMethod · 0.95

Calls 1

formatMethod · 0.45

Tested by

no test coverage detected