Answer the question
In order to leave comments, you need to log in
How to convert seconds with milliseconds to hours and minutes?
How to convert seconds with milliseconds to hours and minutes? discord.py
The code for which you need to convert:
@bot.event
async def on_voice_state_update(member, before, after):
with open('c:/Python/TOXBOT/database.json', 'r', encoding = "utf-8") as file:
data = json.load(file)
if before.channel is None and after.channel is not None:
t1 = time.time()
data[str(member.id)]['Онлайн'] = t1
elif before.channel is not None and after.channel is None and member.id in tdict:
t2 = time.time()
print(t2-tdict[member.id])
data[str(member.id)]['Онлайн'] + data[str(member.id)]
with open('c:/Python/TOXBOT/database.json', 'w', encoding = "utf-8") as file:
json.dump(data, file)
Answer the question
In order to leave comments, you need to log in
https://stackoverflow.com/questions/35989666/conve...
there are more options with Human formatting
d = datetime.timedelta(milliseconds=418235000)
print d
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question