Answer the question
In order to leave comments, you need to log in
How to organize a primitive countdown timer?
To all ku
There is a view that returns to the context the time until the completion of the action
Here is the line that gets the time in seconds until completion
portal_end_time = (portal_exp_time - datetime.datetime.now()).total_seconds()
def convert(seconds):
seconds = seconds % (24 * 3600)
hour = seconds // 3600
seconds %= 3600
minutes = seconds // 60
seconds %= 60
return "%d:%02d:%02d" % (hour, minutes, seconds)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question