add time to datetime python

Do you want to know the information regarding “add time to datetime python”. If yes, you’re in the correct article.

add time to datetime python

add_time = datetime.timedelta(days=2)
import datetime
delta = datetime.timedelta(
     days=50,
     seconds=27,
     microseconds=10,
     milliseconds=29000,
     minutes=5,
     hours=8,
     weeks=2
)

new_datetime = datetime.now() + delta

Conclusion

I hope this post helps you to know about “add time to datetime python”. If you have any queries regarding this article please let us know via the comment section. Share this article with your friends and 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