sam sam - 1 year ago 108
Python Question

python - how to find datetime 10 mins after current time?

I want to find out the datetime 10 mins after current time. Let's say we have

from datetime import datetime
now =
new_now = datetime.strptime(now, '%a, %d %b %Y %H:%M:%S %Z')

I want to find this
10 minutes later. How can I do that?

Answer Source

This is a duplicate of this question. You basically just need to add a timedelta of 10 minutes to get the time you want.

now =
now_plus_10 = now + datetime.timedelta(minutes = 10)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download