subtract one hour from datetime python

Do you want to know the information about “subtract one hour from datetime python”. If yes, you’re in the correct tutorial.

subtract one hour from datetime python

from datetime import datetime, timedelta

d = datetime.today() - timedelta(hours=0, minutes=50)

d.strftime('%H:%M %p')

Final Thoughts

I hope this tutorial helps you to know about “subtract one hour from datetime python”. If you have any doubts regarding this post please let us know via the comment section. Share this tutorial with your friends & family via social networks.

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coder Diksha. Here, I post about programming to help developers.

Share on:

Leave a Comment