MCPcopy
hub / github.com/mxrch/GHunt / get_datetime_utc

Function get_datetime_utc

ghunt/helpers/utils.py:72–76  ·  view source on GitHub ↗

Converts ISO to datetime object in UTC

(date_str)

Source from the content-addressed store, hash-verified

70 return str(obj).strip("<>").split(" ")[0]
71
72def get_datetime_utc(date_str):
73 """Converts ISO to datetime object in UTC"""
74 date = isoparse(date_str)
75 margin = date.utcoffset()
76 return date.replace(tzinfo=timezone.utc) - margin
77
78def ppnb(nb: float|int) -> float:
79 """

Callers 4

_scrapeMethod · 0.90
_scrapeMethod · 0.90
_scrapeMethod · 0.90
_scrapeMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected