'''
DateTime
1. How to initialize
2. Playing with Date Objects
3. TimeDelta
4. Conversion to diferent date formats
'''
import datetime
x = datetime.date(2019, 12, 12)
y= datetime.datetime(2019,12,12,10,00,00)
print(x)
print(y)
print(x.year)
print(x.month)
print(x.day)
#TimeDelta - It represents the difference in time between two Objects
x = datetime.date(year = 2019, month = 1, day = 1)
y = datetime.date(year = 2020, month = 1, day = 1)
print(y-x)
print(type(y-x))
print((y-x).total_seconds())
now = datetime.datetime.now()
print(now)
print(now.strftime("%d/%m/%Y, %H:%M:%S"))
print(now.strftime("%d-%m-%Y, %H:%M:%S"))
In questa pagina del sito puoi guardare il video online Python Tutorial for beginners | Playing with Date and Time in Python della durata di ore minuti seconda in buona qualità , che l'utente ha caricato harshal mishra 27 aprile 2020, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 12 volte e gli è piaciuto 0 spettatori. Buona visione!