Skip to content

Commit

Permalink
Improved time formatting in output
Browse files Browse the repository at this point in the history
  • Loading branch information
Kataiser committed Jun 9, 2019
1 parent 28024b4 commit 5c9ecfe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions TF2 Rich Presence/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def loop_body(self):

# used for display only
current_time = datetime.datetime.now()
current_time_formatted: str = current_time.strftime('%I:%M:%S %p')
current_time_formatted: str = current_time.strftime('%I:%M:%S %p').lstrip('0')

if tf2_is_running and discord_is_running:
if not self.has_checked_class_configs:
Expand Down Expand Up @@ -274,8 +274,8 @@ def loop_body(self):
print(f"{current_time_formatted}{generate_delta(self.last_notify_time)}")
print(f"{self.activity['details']} ({self.activity['assets']['large_text']})")
print(self.activity['state'])
time_elapsed = int(time.time() - self.start_time)
print(f"{datetime.timedelta(seconds=time_elapsed)} elapsed")
time_elapsed = datetime.timedelta(seconds=int(time.time() - self.start_time))
print(f"{str(time_elapsed).lstrip('0:')} elapsed")
print()

self.log.debug(f"Activity changed, outputting (old: {self.old_activity}, new: {self.activity})")
Expand Down

0 comments on commit 5c9ecfe

Please sign in to comment.