Answers for "timestamps to date python"

4

convert to timestamp python

import datetime
date = '18/05/2020 - 18:05:12'

# convert string to datetimeformat
date = datetime.datetime.strptime(date, "%d %m %Y - %H:%M:%S"")

# convert datetime to timestamp
date = datetime.datetime.timestamp(date)
Posted by: Guest on May-05-2020
1

python datetime to timestamp

import datetime
now = datetime.datetime.today()
timestamp = datetime.datetime.timestamp(now)
Posted by: Guest on January-26-2021
0

python 2.7 datetime to timestamp

import time
from datetime import datetime
d = datetime(2017, 6, 11, 0, 0)

unixtime = time.mktime(d.timetuple())
Posted by: Guest on September-03-2020

Python Answers by Framework

Browse Popular Code Answers by Language