by @kodeazy
How to convert timestamp to datetimeformat in python?
- With the help of
time.strftime
function we can convert timestamp into date time format. - To use
time.strftime
we have to importtime
. -
Below is the sample example.
import time ts=time.time() time.strftime("%D %H:%M", time.localtime(ts))
Output:
'03/30/22 17:28'