refactor: Fix serialize_datetime function in model.py
This commit is contained in:
parent
031b82c665
commit
a3a09fed3b
1 changed files with 1 additions and 1 deletions
|
|
@ -118,7 +118,7 @@ class FlowBase(SQLModel):
|
|||
if isinstance(value, datetime):
|
||||
# I'm getting 2024-05-29T17:57:17.631346
|
||||
# and I want 2024-05-29T17:57:17-05:00
|
||||
value.microsecond = 0
|
||||
value = value.replace(microsecond=0)
|
||||
if value.tzinfo is None:
|
||||
value = value.replace(tzinfo=timezone.utc)
|
||||
return value.isoformat()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue