Answers for "python datetime .strptime"

11

python datetime string

import datetime

today = datetime.datetime.now()
date_time = today.strftime("%m/%d/%Y, %H:%M:%S")
print("date and time:",date_time)
Posted by: Guest on May-21-2020
11

python datetime string

import datetime

today = datetime.datetime.now()
date_time = today.strftime("%m/%d/%Y, %H:%M:%S")
print("date and time:",date_time)
Posted by: Guest on May-21-2020
0

datetime today

from datetime import datetime

# datetime object containing current date and time
now = datetime.now()
 
print("now =", now)

# dd/mm/YY H:M:S
dt_string = now.strftime("%d/%m/%Y %H:%M:%S")
print("date and time =", dt_string)
Posted by: Guest on September-01-2020
0

datetime today

from datetime import datetime

# datetime object containing current date and time
now = datetime.now()
 
print("now =", now)

# dd/mm/YY H:M:S
dt_string = now.strftime("%d/%m/%Y %H:%M:%S")
print("date and time =", dt_string)
Posted by: Guest on September-01-2020

Python Answers by Framework

Browse Popular Code Answers by Language