Answers for "python times"

22

python time library

#also see datetime
import time
now = time.time()
print(now)
Posted by: Guest on February-21-2020
9

time module in python

import time
seconds = time.time()
print("Seconds since epoch =", seconds)
Posted by: Guest on July-30-2020
0

python timestanp

#!/usr/bin/python3
import time
import datetime

start = "10/03/2021 08:00:00"
timestmp_start=int(time.mktime(datetime.datetime.strptime(start, "%d/%m/%Y %H:%M:%S").timetuple()))*1000
date_start=datetime.datetime.fromtimestamp(timestmp_start/1000).strftime("%d/%m/%Y %H:%M:%S")


#output:
#timestmp_start: 1615343400000
#date_start: "10/03/2021 08:00:00"
Posted by: Guest on March-12-2021
0

string times python

>>> os = "our string " >>> os * 5 'our string our string our string our string our string ' 
Posted by: Guest on October-07-2020

Python Answers by Framework

Browse Popular Code Answers by Language