js时间戳转化为时间 //时间戳转时间 function time(sj) { var now = new Date(sj*1000); var year =now.getFullYear(); var month =now.getMonth()+1; var date =now.getDate(); var hour =now.getHours(); var minute =now.getMinutes(); var second =now.getSeconds(); return year+…
在linux上想获取文件的元信息,我们需要使用系统调用lstat或者stat. 在golang的os包里已经把stat封装成了Stat函数,使用它比使用syscall要方便不少. 这是os.Stat的原型: func Stat(name string) (FileInfo, error) Stat returns a FileInfo describing the named file. If there is an error, it will be of type *PathError. 返…