MCPcopy Create free account
hub / github.com/StackStorm/st2 / _convert_from_datetime

Method _convert_from_datetime

st2common/st2common/fields.py:89–96  ·  view source on GitHub ↗

Convert a `datetime` object to number of microseconds since epoch representation (which will be stored in MongoDB). This is the reverse function of `_convert_from_db`.

(self, val)

Source from the content-addressed store, hash-verified

87 """
88
89 def _convert_from_datetime(self, val):
90 """
91 Convert a `datetime` object to number of microseconds since epoch representation
92 (which will be stored in MongoDB). This is the reverse function of
93 `_convert_from_db`.
94 """
95 result = self._datetime_to_microseconds_since_epoch(value=val)
96 return result
97
98 def _convert_from_db(self, value):
99 result = self._microseconds_since_epoch_to_datetime(data=value)

Callers 3

__set__Method · 0.95
to_mongoMethod · 0.95
prepare_query_valueMethod · 0.95

Tested by

no test coverage detected