MCPcopy Create free account
hub / github.com/TheSmallHanCat/flow2api / normalize_dt

Function normalize_dt

src/api/admin.py:799–809  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

797 now = datetime.now(timezone.utc)
798
799 def normalize_dt(value):
800 if not value:
801 return None
802 if isinstance(value, str):
803 try:
804 value = datetime.fromisoformat(value.replace("Z", "+00:00"))
805 except Exception:
806 return None
807 if getattr(value, "tzinfo", None) is None:
808 return value.replace(tzinfo=timezone.utc)
809 return value.astimezone(timezone.utc)
810
811 return [{
812 "id": row.get("id"),

Callers 1

get_tokensFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected