我有以下字符串“2012-09-04T00:11:20.000Z”,我需要使用 ash shell 将此字符串转换为时间戳。
怎么做?
最佳答案
你可以试试这个:
date -d "2012-09-04T00:11:20.000Z" "+%s"
-d str : 设置str描述的时间
%s : 时间戳格式
关于linux - 如何将时间字符串转换为时间戳,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18231139/