Converting unix timestamp string to readable date

前端 未结 15 2439
别跟我提以往
别跟我提以往 2020-11-22 04:30

I have a string representing a unix timestamp (i.e. \"1284101485\") in Python, and I\'d like to convert it to a readable date. When I use time.strftime, I get a

15条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-22 05:20

    timestamp ="124542124"
    value = datetime.datetime.fromtimestamp(timestamp)
    exct_time = value.strftime('%d %B %Y %H:%M:%S')
    

    Get the readable date from timestamp with time also, also you can change the format of the date.

提交回复
热议问题