There was an error while loading. Please reload this page.
2 parents 8c1ea91 + e99e9b8 commit 401eab7Copy full SHA for 401eab7
1 file changed
c8y_api/model/_util.py
@@ -5,7 +5,6 @@
5
from typing import Union
6
7
from dateutil import parser
8
-from pandas import to_datetime
9
10
11
class _StringUtil(object):
@@ -98,7 +97,8 @@ def ensure_datetime(arg):
98
97
"""Ensure a datetime object."""
99
if isinstance(arg, datetime):
100
return arg
101
- return to_datetime(arg)
+ result = datetime.fromisoformat(arg)
+ return result if result.tzinfo else result.replace(tzinfo=timezone.utc)
102
103
@staticmethod
104
def ensure_timestring(time):
0 commit comments