Send datetimes with timezone when scheduling

This fixes this feature on Pleroma
pull/244/merge
Ivan Habunek 2022-12-07 14:59:40 +01:00
rodzic d6f5728486
commit 3e828c05d9
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: CDBD63C43A30BB95
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -2,7 +2,7 @@
import sys
from datetime import datetime, timedelta
from datetime import datetime, timedelta, timezone
from toot import api, config
from toot.auth import login_interactive, login_browser_interactive, create_app_interactive
from toot.exceptions import ApiError, ConsoleError
@ -132,8 +132,8 @@ def _get_scheduled_at(scheduled_at, scheduled_in):
return scheduled_at
if scheduled_in:
scheduled_at = datetime.utcnow() + timedelta(seconds=scheduled_in)
return scheduled_at.isoformat()
scheduled_at = datetime.now(timezone.utc) + timedelta(seconds=scheduled_in)
return scheduled_at.replace(microsecond=0).isoformat()
return None