Datetime Module (Dates and Times) || Python Tutorial || Learn Python Programming

///Datetime Module (Dates and Times) || Python Tutorial || Learn Python Programming

Datetime Module (Dates and Times) || Python Tutorial || Learn Python Programming

FavoriteLoadingAdd to favorites

Python gives you three classes for working with dates and times: the date, time and datetime classes. All three classes are found in the datetime module. In this lesson we will cover the main uses of all three classes.

➢➢➢➢➢➢➢➢➢➢
To learn Python, you can watch our playlist from the beginning:

➢➢➢➢➢➢➢➢➢➢
We dedicate this video to our VIP Patron Tracy Karin Prell, who does so much to support our efforts at Socratica. Thank you, Tracy!

➢➢➢➢➢➢➢➢➢➢
We recommend:
Python Cookbook, Third edition from O’Reilly

The Mythical Man Month – Essays on Software Engineering & Project Management

Shop Amazon Used Textbooks – Save up to 90%

➢➢➢➢➢➢➢➢➢➢
Subscribe to Socratica:

To support more videos from Socratica, visit
Socratica Patreon

Socratica Paypal

We also accept Bitcoin! 🙂
Our address is: 1EttYyGwJmpy9bLY2UcmEqMJuBfaZ1HdG9

➢➢➢➢➢➢➢➢➢➢
Python instructor: Ulka Simone Mohanty
Written & Produced by Michael Harrison
FX by Andriy Kostyuk

source

By |2019-05-17T19:01:49+00:00May 17th, 2019|Python Video Tutorials|34 Comments

34 Comments

  1. Krishna Koirala May 17, 2019 at 7:01 pm - Reply

    Wonderful always

  2. Matthew Bishop May 17, 2019 at 7:01 pm - Reply

    wait, let me go get my fancy pants.

  3. Kriel May 17, 2019 at 7:01 pm - Reply

    I would ask her more about… a date

  4. Rajorshi Roy May 17, 2019 at 7:01 pm - Reply

    How can you look so serious and be funny at the same time!?

  5. Not Real May 17, 2019 at 7:01 pm - Reply

    I’ll take that 3 bit coin bet.

  6. BlackHat Gaming May 17, 2019 at 7:01 pm - Reply

    Awesome way

  7. A.I.R May 17, 2019 at 7:01 pm - Reply

    I like her

  8. nolifeboy May 17, 2019 at 7:01 pm - Reply

    great! now i can further my "matrix complex" of acting like im living in the matrix lol

  9. Bhupinder Kumar May 17, 2019 at 7:01 pm - Reply

    You should upload long vedios

  10. sighage May 17, 2019 at 7:01 pm - Reply

    LOL @ a date with time

  11. Main Sequence May 17, 2019 at 7:01 pm - Reply

    I could listen to her talk all day.

  12. Debarghya Dutta May 17, 2019 at 7:01 pm - Reply

    Nice Vid. I can do the mograph better, but congrats on getting the concept out! You are doing an awesome job. The inside jokes and mograph and the foley along with focused content is creating quite an experience!
    2 years and less than 100K views, wow! No worries, give it time. Make no mistake, you have done a great job!

  13. anup sharma May 17, 2019 at 7:01 pm - Reply

    from where do python capture this Date and time? Is it from PC or from the internet. Which function is called in backend please explain.

  14. Manish Gurung May 17, 2019 at 7:01 pm - Reply

    You are best narrator! Love your humor and your examples..🤩

  15. Krisnberry May 17, 2019 at 7:01 pm - Reply

    I have downloaded spyder. Is that enough to learn python or should I uninstall that install any other software?

  16. MD Sadaquat hussain May 17, 2019 at 7:01 pm - Reply

    Guess what she was signed by a Hollywood director for dubbing someones voice..

  17. Zerofever May 17, 2019 at 7:01 pm - Reply

    I just want Ulka to narrate my whole life.

  18. Senthilvel Murugesan May 17, 2019 at 7:01 pm - Reply

    Not just the content, even the narrator is so compelling to understand, some time I feel like she is a computer-generated model. I think I am in love with her. Good work, I will strike subtle persuasion in others mind for sure, since she asked 🙂

  19. Reda May 17, 2019 at 7:01 pm - Reply

    put it on 1.5 speed and you will be in another world

  20. D. Sergio Gomes Rosas May 17, 2019 at 7:01 pm - Reply

    Hello Socratica… I need sum two hours…

    05:48:12
    + 03:40:50
    ———————-
    = 09:29:02

    a need do it

    hour1 = int(input(HH:MM:SS)
    hour2 = int(input(HH:MM:SS)

    total_time = hour + hour2
    print(f' Total {total_time)')

    ===================================================================
    But I did it

    h1 = int(input(' Hour 1: '))
    m1 = int(input(' Minute 1: '))
    s2 = int(input(' Second 1: '))

    h2 = int(input(' Hour 2: '))
    m2 = int(input(' Minute 2: '))
    s1 = int(input(' Second 2: '))

    total_hour = h1 + h2
    total_minute = m1 + m2

    if total_minute > 60:
    total_minute = (m1 + m2) – 60 + 1
    total_hour = (h1 + h2) + 1

    st = s1 + s2
    if total_second > 60:
    total_second = (s1 + s2) – 60
    print('n')
    print(f' {total_hout}:{total_minute}:{total_second:0>2} ')

    Is there a way to simplify this?

    Thank you very much!

  21. Chiramisu May 17, 2019 at 7:01 pm - Reply

    Curses!! You let me down @Socratica!! I wanted to know how to convert a string to a date, BUT retain the same format in the output as the input. e.g. if input format was "%Y-%m-%d" then output should be the same, without the "00:00:00" on the end. >.<

  22. Remix LMA May 17, 2019 at 7:01 pm - Reply

    Good evening Socratica,

    I'm a young curious student (17 years old) and I do like your videos.
    It's very useful, yet I do have a question.
    I'm working with Python in jupyter notebook. And if I try to run this datetime modules (like you describes), I recieve the following error:

    —————————————————————————

    NameError Traceback (most recent call last)

    <ipython-input-1-0aa424054e57> in <module>

    —-> 1 miguel = datetime.date(2001, 5, 27)

    2 print(miguel)

    NameError: name 'datetime' is not defined

    Can you or someone else in this community help me to solve this problem? I'm looking forward to see a comment, thank you in advance!

    Best regards,
    Miguel

  23. Kenny's Labotatory May 17, 2019 at 7:01 pm - Reply

    I want more friends like Socratica.

  24. Prasis Poudel Computing May 17, 2019 at 7:01 pm - Reply

    Thank you very much #Socratica. It helped a lot for the college coursework. gonna share this thing.

  25. Brennan Bugbee May 17, 2019 at 7:01 pm - Reply

    who's the narrator? GLaDOS?

  26. Neethu-Paul Alan May 17, 2019 at 7:01 pm - Reply

    Best series! Thank you, Socratica. Love the narration and content.

  27. Sandeep Anand May 17, 2019 at 7:01 pm - Reply

    These are basic python videos…can you please make advance python videos….you really teach very well…
    or please guide me where i can learn python intermediate and advance programming for free…..plz
    i am financially poor..
    my mail id : me.anand.sandeep@gmail.com … . plz guide me

  28. Mohammadbilal Niazy May 17, 2019 at 7:01 pm - Reply

    thanks sister for helping ppl

  29. Handsome_Hero May 17, 2019 at 7:01 pm - Reply

    Well learning Python from scratch is great. You can multiply numbers, display text and show the date and time. Which is just as well because calculators and calendars can't do that already. <facepalm>

  30. Games TV May 17, 2019 at 7:01 pm - Reply

    This video interface reminds me of the "Command and conquer' series of games.

  31. bushwhack12 May 17, 2019 at 7:01 pm - Reply

    Ha ha love the ending.

  32. Gergely H May 17, 2019 at 7:01 pm - Reply

    3:49 There is an even more modern way of displaying date with a custom formatting called fstring (described in PEP 498). The example shown here would look like this:
    >>> print(f"GVR was born on {gvr:%A, %B %d, %Y}.")

  33. AYUSH RAJ BURNWAL May 17, 2019 at 7:01 pm - Reply

    Mam please make more videoes in Python you r providing a very quality education please make more videoes

  34. SomeGuyInSandy May 17, 2019 at 7:01 pm - Reply

    "Man landed on the moon for the first time on Sunday, July 20, 1969" – sweet!

Leave A Comment

*