date -d @時間戳 "+%Y-%m-%d %H:%M:%S"
也可以內置函數
awk '{print strftime("%Y-%m-%d %H:%M:%S", $1)}'
如果是毫秒級的時間戳要先除以1000;
在 shell 中這樣子處理:
awk '{print $1","$2","strftime("%Y-%m-%d %H:%M:%S", $3)}' origin.txt > origin.csv
date -d @時間戳 "+%Y-%m-%d %H:%M:%S"
也可以內置函數
awk '{print strftime("%Y-%m-%d %H:%M:%S", $1)}'
如果是毫秒級的時間戳要先除以1000;
在 shell 中這樣子處理:
awk '{print $1","$2","strftime("%Y-%m-%d %H:%M:%S", $3)}' origin.txt > origin.csv
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。