diff --git a/core/xtream_codes.py b/core/xtream_codes.py index b4d976c5..9b56197a 100644 --- a/core/xtream_codes.py +++ b/core/xtream_codes.py @@ -140,16 +140,16 @@ class Client: """Get account information from the last authentication response""" if not self.server_info: raise ValueError("Not authenticated. Call authenticate() first.") - + from datetime import datetime - + # Extract relevant account information user_info = self.server_info.get('user_info', {}) server_info = self.server_info.get('server_info', {}) - + account_info = { - 'last_refresh': datetime.now().isoformat(), - 'auth_timestamp': datetime.now().timestamp(), + 'last_refresh': datetime.utcnow().isoformat() + 'Z', # Explicit UTC with Z suffix + 'auth_timestamp': datetime.utcnow().timestamp(), 'user_info': { 'username': user_info.get('username'), 'password': user_info.get('password'), @@ -174,7 +174,7 @@ class Client: 'time_now': server_info.get('time_now') } } - + return account_info def get_live_categories(self): diff --git a/frontend/src/components/forms/AccountInfoModal.jsx b/frontend/src/components/forms/AccountInfoModal.jsx index 4c0fba39..03ff3d62 100644 --- a/frontend/src/components/forms/AccountInfoModal.jsx +++ b/frontend/src/components/forms/AccountInfoModal.jsx @@ -47,9 +47,18 @@ const AccountInfoModal = ({ isOpen, onClose, profile }) => { try { const date = typeof timestamp === 'string' && timestamp.includes('T') - ? new Date(timestamp) + ? new Date(timestamp) // This should handle ISO format properly : new Date(parseInt(timestamp) * 1000); - return date.toLocaleString(); + + // Convert to user's local time and display with timezone + return date.toLocaleString(undefined, { + year: 'numeric', + month: 'short', + day: 'numeric', + hour: '2-digit', + minute: '2-digit', + timeZoneName: 'short', + }); } catch { return 'Invalid date'; } @@ -330,7 +339,7 @@ const AccountInfoModal = ({ isOpen, onClose, profile }) => { > - Last Updated: + Last Account Info Refresh: {last_refresh ? formatTimestamp(last_refresh) : 'Never'}