Fix: Add UTC timezone info to message.timestamp. (#4129)
This commit is contained in:
parent
376e4cfdd3
commit
e2e3369f93
1 changed files with 4 additions and 1 deletions
|
|
@ -42,7 +42,10 @@ class MessageBase(SQLModel):
|
|||
message.files = image_paths
|
||||
|
||||
if isinstance(message.timestamp, str):
|
||||
timestamp = datetime.fromisoformat(message.timestamp)
|
||||
# The message.timestamp is created using strftime("%Y-%m-%dT%H:%M:%S").
|
||||
# This format is not fully ISO 8601 compliant because it lacks timezone information.
|
||||
# Aadd timezone info (UTC) back to the timestamp here.
|
||||
timestamp = datetime.fromisoformat(message.timestamp).replace(tzinfo=timezone.utc)
|
||||
else:
|
||||
timestamp = message.timestamp
|
||||
if not flow_id and message.flow_id:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue