Python Datetime objects and Timedelta | Python30 | Day 2

preview_player
Показать описание
On Day 2 of the #Python30 course, we are going to discuss python datetime objects and timedelta. With some simple guidelines and practical examples, you would be able to implement date and time objects efficiently in all your Python applications.

Once you are done with the video, make sure to check out the GitHub repo for solving the questions associated with python datetime objects and timedelta. This will really help you master the concepts and build confidence in this topic.

#Python30 Github Repository :-

For more description on the #Python30 course, check out the above Github Repository.

My blog on Mastering Python datetime -

Complete List of String Formatting for Python datetime objects.

Check out my website -

Check out my facebook page -

Check out my twitter handle -
Рекомендации по теме
Комментарии
Автор

Hi Lenin, thanks for the effort put in to take time out for us and making videos. For ascertaining a time in the past, instead of giving negative value to Days, Hours and Minutes, I would just minus the time_diff from the date_time like past_date_time = date_time - time_diff. This would give the same result I guess. Thanks again..

vickysharma_
Автор

Thank for the effort. But please make a video difference of two dates and difference results is only in days

nagarjunatutika
Автор

Interesting. Thanks a lot 😊 question 🙋
1. How do I convert this easily to Long number format?
2. Any updates on the large csv reading video?

shaarg
Автор

So whats the difference between Datetime Module and Time Module ?

drummerbytune
Автор

My solution to Problem 1:


from datetime import date, timedelta

christmas = date(year=2019, month=12, day=25)

time_diff = timedelta(days = 7)

one_week_before_christmas = christmas - time_diff

one_week_before_christmas

vickysharma_
Автор

My solution to Problem 2:


from datetime import datetime, timedelta
day_in_future = datetime(year = 2020, month = 5, day = 20, hour = 22, minute = 30)
day_in_past = datetime(year = 2019, month=1, day=1, hour=11)
time_diff = day_in_future - day_in_past
time_diff

vickysharma_
Автор

Hi, your explanation is easy to understand. My timedelta is in Is it the same as datetime.timedelta?

Michael-scyt