Send datetimes with timezone when scheduling

This fixes this feature on Pleroma
This commit is contained in:
Ivan Habunek 2022-12-07 14:59:40 +01:00
parent d6f5728486
commit 3e828c05d9
No known key found for this signature in database
GPG Key ID: CDBD63C43A30BB95
1 changed files with 3 additions and 3 deletions

View File

@ -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