string python DateTime
import datetime
today = datetime.datetime.now()
date_time = today.strftime("%m/%d/%Y, %H:%M:%S")
print("date and time:",date_time)
marcofaga
import datetime
today = datetime.datetime.now()
date_time = today.strftime("%m/%d/%Y, %H:%M:%S")
print("date and time:",date_time)
from datetime import datetime
timestamp = 1586507536367
dt_object = datetime.fromtimestamp(timestamp)
import time
timestamp = 1547281745
datetime = time.strftime('%A, %Y-%m-%d %H:%M:%S', time.localtime(timestamp))
print(datetime)
import datetime
now = datetime.datetime.today()
timestamp = datetime.datetime.timestamp(now)
from datetime import datetime
timestamp = 1545730073
dt_object = datetime.fromtimestamp(timestamp)
print("dt_object =", dt_object)
print("type(dt_object) =", type(dt_object))
from datetime import datetime
# current date and time
now = datetime.now()
timestamp = datetime.timestamp(now)
print("timestamp =", timestamp)