Write a program to convert date to timestamp and print the result


Topic: Write a program to convert date to timestamp and print the result

Solution

import time 
import datetime 
str1 = "20/01/2020"
element = datetime.datetime.strptime(str1,"%d/%m/%Y") 
timestamp = datetime.datetime.timestamp(element) 
print(timestamp)



List all Python Programs