python
import datetime
now = datetime.datetime.now()
print(now)
print(now.isoformat())
print(now.strftime('%d/%m/%Y-%H:%M:%S:%f'))
print('##########')
today = datetime.date.today()
print(today)
print(today.isoformat())
print(today.strftime('%d/%m/%y'))
print('##########')
t = datetime.time(hour=1, minute=15, second=30, microsecond=100)
print(t)
print(t.isoformat())
print(t.strftime('%H:%M:%S:%f'))
Résultat d'exécution
2020-02-26 10:56:54.691417
2020-02-26T10:56:54.691417
26/02/2020-10:56:54:691417
##########
2020-02-26
2020-02-26
26/02/20
##########
01:15:30.000100
01:15:30.000100
01:15:30:000100
Recommended Posts