subtract one hour from datetime python

Solutions on MaxInterview for subtract one hour from datetime python by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "subtract one hour from datetime python"
Lia
29 Jun 2019
1from datetime import datetime, timedelta
2
3d = datetime.today() - timedelta(hours=0, minutes=50)
4
5d.strftime('%H:%M %p')
6