Ultimate Guide to Datetime! Python date and time objects for beginners

preview_player
Показать описание
Hi everyone! today we will talk about the Datetime module, which helps us load and manipulate date and time data in Python. The main reason why Datetime is so important is because Python doesn't really have a built-in data type for dates (and times) 🗓️⌚- but we can easily import them from the datetime module! 😀

So in this tutorial - we will discuss and experiment with the most important commands from the documentation, focusing on 3 different classes: date, datetime and time.
We will learn how to create and manipulate each of these and we will also convey them with different formatting methods.

⭐ Complete Tutorial Code: ⭐

⏰ TIMESTAMPS ⏰
----------------------------------------------------
00:00 - intro
00:27 - python date object
01:17 - date attributes
01:49 - date formatting
03:59 - replace date attributes
04:33 - countdown to date
05:44 - load date using attributes
06:18 - load date using string
07:03 - find weekday of date
07:40 - python datetime object
08:16 - datetime attributes
09:31 - load datetime using string
11:02 - advanced datetime formatting
12:14 - time zone attribute
12:35 - datetime time object
13:44 - convert 24 hour time to 12 hour time
14:28 - combine date and time objects into a datetime object
15:25 - thanks for watching!

🔗 LINKS FROM TUTORIAL 🔗
----------------------------------------------------
⭐ Classes and Objects Tutorial:

⭐ Datetime Documentation - format codes:

👋 THANKS FOR WATCHING 👋
----------------------------------------------------
Рекомендации по теме
Комментарии
Автор

Hi There. Just a comment. Regarding printing format strings, I gonna say this is better and easier: { print(f"Today is: {today}") }

azizmiya
Автор

I used datetime module several times in my python projects but always looking for solutions to specific situations and I've never tried to arrange my knowledge. Thanks a lot for this video. It is really helpful. I discovered your channel few weeks ago and it will surely be one of my favourites

mchess
Автор

yes, we can do!
from datetime import datetime
user = user.datetime()
start = user.strftime("%m/%d/%Y/%A, %H:%M:%S:%p")
print("Date & Time:", start)

your tutorial is easy to understandable :) and thanks for this.

abdulbasitminhas
Автор

Thank you so much!!! I have been struggling with writing the middle of a program for 2 months. After following the steps in your video and struggling with line 50 to discover my system had to have string properties assigned to add timezone offset I went to my program assigned my date object as a string and my program worked. So simple but so much grief. Would have never found it without your video!!!

chalmerditmars
Автор

Bingo! I just spent so much time trying to figure this out and your video cleared it up really quickly. Thanks

Wyatt-Barton
Автор

I don't know if I haven't looked for more channels but I think this is the first blog about python done in a more fluid way. Thanks for giving us this, I really need to practice

lad
Автор

It's difficult to understand how being almost 3 am you look so plenty of energy and shining (every square centimeter of your face) You are awesome Mariya Sha!! I can't find anything for complain. UR Simply a perfect teacher, trainner and YouTuber. You find the way to build the bridge between learners and the new knowledge.

AcademiaCS
Автор

Very cool tutorial, I like how you're concise and to the point.

theRealtensigh
Автор

Dear Mariya, thanks for all your videos. They are awesome! Keep up the good work. 🥳😊

fabiano
Автор

I have struggled with Python's date and time methods. This video was really helpful for me. Thanks!

serenadenphoto
Автор

Funny I was watching this (almost) on your birthday! Happy birthday!

donesy
Автор

Your tutorials very clear and understandable! Thank you!

slonbeskonechen
Автор

Wow! So glad I found your channel! This is super helpful!

sherryab
Автор

Clean and fast code, I love it. Belated happy birthday too XD

rohanchess
Автор

Excellent video as always,
full of useful information! Thanks!
תודה! 😀

balazsberes
Автор

Thank you, very informative and helpful

MrPioneer
Автор

very helpful video, thanks for your help

MS-qkcz
Автор

Happy birthday^^ Thank you so much for lots of great videos!!

jongcheulkim
Автор

Quite the tribute @5:49! That caught my attention as everyones favourite electrician. 😎

CurrentElectrical
Автор

Wow, I followed you great up until Your line #50, I got errors there googled and googled and could find no help for my error. I thought my version of python was different than yours, I added a date and used datetime and it worked great. Tried a lot of other things too, finally entered it as: and wham it worked!!! My system with time must have read the "-" and stored something as an integer, Just had to tell the program that this is a string. You have wonderful energy and do an excellent job of converting high tech into common English, a rare gift. Thank You so much!!!!

chalmerditmars