I
I
Ivan2020-11-17 01:10:43
Python
Ivan, 2020-11-17 01:10:43

Analog of .strftime() for unixtime (time.time())?

How to use .strftime, UNIXTIME only (time.time())?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
shurshur, 2020-11-17
@mlneko

from time import strftime,time,localtime
print (strftime("%Y-%m-%d", localtime(time())))

O
ohaio ohaio, 2020-11-17
@emelyanko

import time
print(time.strftime('%Y-%m-%d %H:%M:%S'))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question