#get date from unix timestamp
from datetime import date
timestamp = date.fromtimestamp(1326244364)
from datetime import datetime
# current date and time
currentDateTime = datetime.now()
print("Current Date Time is ", currentDateTime)
# convert datetime to timestamp
timestamp = datetime.timestamp(currentDateTime)
print("Current Unix Timestamp is ", timestamp)
dates = pd.to_datetime(['2019-01-15 13:30:00'])
(dates - pd.Timestamp("1970-01-01")) // pd.Timedelta('1s')
# Int64Index([1547559000], dtype='int64')
# importing datetime module
import datetime
import time
# assigned regular string date
date_time = datetime.datetime(2021, 7, 26, 21, 20)
# print regular python date&time
print("date_time =>",date_time)
# displaying unix timestamp after conversion
print("unix_timestamp => ",
(time.mktime(date_time.timetuple())))