Here’s my code, it’s just supposed to basically change end to start + 25 minutes.
I’m just wondering if there is a way to update datetime.datetime.now() to be the current time.
As it stands, it just stays at whatever it was when I first used the module.
So the if statement will never be true.
import datetime
start = datetime.datetime.now()
end = start + datetime.timedelta(minutes = 25)
if start == end:
end = end + datetime.timedelta(minutes = 25)
As CharlesB has suggested, the start variable is not updated. You need to take the now value at the time you want to perform the test.
Rewrite the line:
To
EDIT
After Tommo’s comment, I think another solution may be easier.