Skip to content

Fixed .utcfromtimestamp() deprecation error #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import os
import hashlib
from time import sleep
from datetime import datetime
from datetime import datetime, UTC

# import json as jsond
# ^^ only for auto login/json writing/reading
Expand Down Expand Up @@ -173,15 +173,15 @@ def answer():
subs = keyauthapp.user_data.subscriptions # Get all Subscription names, expiry, and timeleft
for i in range(len(subs)):
sub = subs[i]["subscription"] # Subscription from every Sub
expiry = datetime.utcfromtimestamp(int(subs[i]["expiry"])).strftime(
expiry = datetime.fromtimestamp(int(subs[i]["expiry"]), UTC).strftime(
'%Y-%m-%d %H:%M:%S') # Expiry date from every Sub
timeleft = subs[i]["timeleft"] # Timeleft from every Sub

print(f"[{i + 1} / {len(subs)}] | Subscription: {sub} - Expiry: {expiry} - Timeleft: {timeleft}")

print("Created at: " + datetime.utcfromtimestamp(int(keyauthapp.user_data.createdate)).strftime('%Y-%m-%d %H:%M:%S'))
print("Last login at: " + datetime.utcfromtimestamp(int(keyauthapp.user_data.lastlogin)).strftime('%Y-%m-%d %H:%M:%S'))
print("Expires at: " + datetime.utcfromtimestamp(int(keyauthapp.user_data.expires)).strftime('%Y-%m-%d %H:%M:%S'))
print("Created at: " + datetime.fromtimestamp(int(keyauthapp.user_data.createdate), UTC).strftime('%Y-%m-%d %H:%M:%S'))
print("Last login at: " + datetime.fromtimestamp(int(keyauthapp.user_data.lastlogin), UTC).strftime('%Y-%m-%d %H:%M:%S'))
print("Expires at: " + datetime.fromtimestamp(int(keyauthapp.user_data.expires), UTC).strftime('%Y-%m-%d %H:%M:%S'))
print("\nExiting in five seconds..")
sleep(5)
os._exit(1)