Skip to content

Commit 1783bd0

Browse files
committed
Fix timestamp handling
1 parent 2a80e57 commit 1783bd0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mautrix_appservice/intent_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from json.decoder import JSONDecodeError
2020
from typing import Optional, Dict, Awaitable, List, Union, Tuple, Any
2121
from logging import Logger
22-
from datetime import datetime
22+
from datetime import datetime, timezone
2323
import re
2424
import json
2525
import asyncio
@@ -115,7 +115,7 @@ def request(self, method: str, path: str, content: Optional[Union[dict, bytes, s
115115

116116
if timestamp is not None:
117117
if isinstance(timestamp, datetime):
118-
timestamp = int(timestamp.timestamp() * 1000)
118+
timestamp = int(timestamp.replace(tzinfo=timezone.utc).timestamp() * 1000)
119119
query_params["ts"] = timestamp
120120
if external_url is not None:
121121
content["external_url"] = external_url

0 commit comments

Comments
 (0)