Datetime Class || Datetime Module || part - 4 ||

Pubblicato il: 16 novembre 2021
sul canale di: Ddhruv Arora
21
4

In this video, I have discussed about:
1. DateTime class of Datetime Module, it's a combination of date and time class with some extra features.
2. How to import it and access its attributes and methods
3. DateTime Constructor Object
4. Typecasting Datetime object to str
5. Replace method, StrfTime method

List of Format Codes that can be used with Strftime method:
code Meaning
%a Abbreviated weekday name.
%A Full weekday name.
%w Weekday as a decimal number.
%d Day of the month as a zero-padded decimal.
%-d Day of the month as a decimal number.
%b Abbreviated month name.
%B Full month name.
%m Month as a zero-padded decimal number.
%-m Month as a decimal number.
%y Year without century as a zero-padded decimal number.
%-y Year without century as a decimal number.
%Y Year with century as a decimal number.
%H Hour (24-hour clock) as a zero-padded decimal number.
%-H Hour (24-hour clock) as a decimal number.
%I Hour (12-hour clock) as a zero-padded decimal number.
%-I Hour (12-hour clock) as a decimal number.
%p Locale’s AM or PM.
%M Minute as a zero-padded decimal number.
%-M Minute as a decimal number.
%S Second as a zero-padded decimal number.
%-S Second as a decimal number.
%f Microsecond as a decimal number, zero-padded on the left.
%j Day of the year as a zero-padded decimal number.
%-j Day of the year as a decimal number.
%U Week number of the year (Sunday as the first day of the week).
%W Week number of the year (Monday as the first day of the week). week
%c Locale’s appropriate date and time representation.
%x Locale’s appropriate date representation.
%X Locale’s appropriate time representation.
%% A literal '%' character. %

syntax:
1. Import Syntax:
import datetime
datetime.datetime.attribute_name_or_method

2. Import Syntax:
from datetime import datetime
datetime.attribute_or_method

3. Syntax for time constructor object:
datetime(year, month, day, hour=0, minute=0, second=0, microsecond=0)

-----------------------------------------------------------------------------------------------------------------------
Tip: Revise older concepts and explore the datetime module.

#python #pythonprogramming #coding
#learning #teaching #youtuber #pythonfrombasics.
-----------------------------------------------------------------------------------------------------------------------
Thank you for watching and reading.
-----------------------------------------------------------------------------------------------------------------------
The only way to do great work is to do what you love.
Perfection is not attainable, but if we chase perfection we can catch excellence.
An investment in knowledge pays the best interest
You become what you consistently practice so practice consistently what you want to become
Our work is the Presentation of Our capabilities
Share Your Knowledge and become Immortal.
By learning, you will teach and by teaching, you will learn.
Learning is a treasure that will follow its owner everywhere.
Learning happily is the way to success.
Revise Rewrite Retry is the stairway to success.
Never stop learning because life never stops teaching.
Every day is a good day to learn something new.
Keep learning every day.
-----------------------------------------------------------------------------------------------------------------------
Happy Coding ahead 👨‍🎓🌟✨
-----------------------------------------------------------------------------------------------------------------------
Keywords:
Ddhruv Arora
Python by Ddhruv Arora
Ddhruv Arora teaches python
Python Ddhruv
Programming and Ddhruv
Python for beginners
python basics
python concepts
python coding and programming
How to code in python
How to use datetime in python
python How to
Python time class how to use it.


In questa pagina del sito puoi guardare il video online Datetime Class || Datetime Module || part - 4 || della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Ddhruv Arora 16 novembre 2021, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 21 volte e gli è piaciuto 4 spettatori. Buona visione!