Skip to content

Commit e7b19fc

Browse files
committed
added fix for date strings without timezone
1 parent 88f108f commit e7b19fc

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

kickbase_api/models/_transforms.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44

55

66
def parse_date(s: str) -> datetime:
7-
return datetime.strptime(s, "%Y-%m-%dT%H:%M:%S%z")
7+
try:
8+
return datetime.strptime(s, "%Y-%m-%dT%H:%M:%S%z")
9+
except:
10+
return datetime.strptime(s+"+0000", "%Y-%m-%dT%H:%M:%S%z")
811

912

1013
def date_to_string(d: datetime) -> str:

0 commit comments

Comments
 (0)