前言

时间处理相关的一些记录

记录

时间格式类型(2021-03-12 03:34:58.744522)

转换时间为unix时间(13位)

shell下的转换

newtime=$[$(date -d "$mytime" +%s%N)/1000000]

python下的转换

import time
mytime="2021-03-12 03:34:58.744522"
ts=time.strptime(mytime,'%Y-%m-%d %H:%M:%S.%f')
print int(round(time.mktime(ts)*1000))

相关文章:

  • 2022-12-23
  • 2021-06-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-28
  • 2022-12-23
  • 2021-08-12
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-07
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案