Answers for "change date in timestamp 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
2

timestamp change python

import time
timestamp = 1547281745
datetime = time.strftime('%A, %Y-%m-%d %H:%M:%S', time.localtime(timestamp))
print(datetime)
Posted by: Guest on May-05-2020

Code answers related to "change date in timestamp python"

Python Answers by Framework

Browse Popular Code Answers by Language