1from datetime import datetime
2
3# datetime object containing current date and time
4now = datetime.now()
5
6print("now =", now)
7
8# dd/mm/YY H:M:S
9dt_string = now.strftime("%d/%m/%Y %H:%M:%S")
10print("date and time =", dt_string)
11
12# now = 2021-06-25 07:58:56.550604
13# date and time = 25/06/2021 07:58:56