diff options
-rw-r--r-- | mastodon/Mastodon.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index e0b9257..9e30429 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py | |||
@@ -3925,15 +3925,9 @@ class Mastodon: | |||
3925 | 3925 | ||
3926 | Assumes UTC if timezone is not given. | 3926 | Assumes UTC if timezone is not given. |
3927 | """ | 3927 | """ |
3928 | date_time_utc = None | ||
3929 | if date_time.tzinfo is None: | 3928 | if date_time.tzinfo is None: |
3930 | date_time_utc = date_time.replace(tzinfo=datetime.timezone.utc) | 3929 | date_time = date_time.replace(tzinfo=datetime.timezone.utc) |
3931 | else: | 3930 | return date_time.timestamp() |
3932 | date_time_utc = date_time.astimezone(datetime.timezone.utc) | ||
3933 | |||
3934 | epoch_utc = datetime.datetime.utcfromtimestamp(0).replace(tzinfo=datetime.timezone.utc) | ||
3935 | |||
3936 | return (date_time_utc - epoch_utc).total_seconds() | ||
3937 | 3931 | ||
3938 | def __get_logged_in_id(self): | 3932 | def __get_logged_in_id(self): |
3939 | """ | 3933 | """ |