多个时间戳转化的脚本

#!/bin/bash
pidfile_="date.txt"
if [ -f ${pidfile_} ]; then
rm -f ${pidfile_}
touch ${pidfile_}
fi
for i in '1534391736975' '1534391736973' '1534391736865'
do
str=${i:0:10}
date -d @${str} "+%Y-%m-%d %H:%M:%S">> date.txt
done
原文地址:https://www.cnblogs.com/cherish010/p/9490100.html