import time

#将10位时间戳或者13位转换为时间字符串,默认为2017-10-01 13:37:04格式
def timestamp_to_date(time_stamp, format_string="%Y-%m-%d %H:%M:%S"):
    time_array = time.localtime(time_stamp/1000)
    other_style_time = time.strftime(format_string, time_array)
    print other_style_time
    return other_style_time
timestamp_to_date(1593693029909)

输出

2020-07-02 20:30:29

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-29
  • 2022-12-23
  • 2022-12-23
  • 2021-12-08
猜你喜欢
  • 2022-12-23
  • 2022-01-25
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-16
相关资源
相似解决方案