Python, datetime "time gap" percentage
Posted
by Hellnar
on Stack Overflow
See other posts from Stack Overflow
or by Hellnar
Published on 2010-03-22T01:17:59Z
Indexed on
2010/03/22
1:21 UTC
Read the original article
Hit count: 379
Hello
Assume I have these datatime variables:
start_time, end_time, current_time
I would like to know how much time left as percentage by checking current_time and the time delta between start_time and the end_time
Like if the interval is a 24 hours, and between now and end_time, there are 6 hours left, %25 should be left.
How can this be done ?
© Stack Overflow or respective owner