怎么来日期转换到错误的时间?
- result=$(ls /path/to/file/File.*)
- #/path/to/file/File.1361234760790
- currentIndexTime=${result##*.}
- echo "$currentIndexTime"
- #1361234760790
- date -d@"$currentIndexTime"
- #Tue 24 Oct 45105 10:53:10 PM GMT
这个特定的时间戳记是从时代开始的毫秒,而不是从时代开始的标准秒数。除以1000:
- $ date -d @1361234760.790
- Mon Feb 18 17:46:00 MST 2013