2 Star 2 Fork 7

王布衣 / gox

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
filestat.go 510 Bytes
Copy Edit Raw Blame History
package api
import (
"errors"
"time"
)
var (
ErrInvaildFileStat = errors.New("invalid file stat")
)
type FileStat struct {
CreationTime time.Time
LastAccessTime time.Time
LastWriteTime time.Time
}
// SecondToTime 把秒级的时间戳转为time格式
func SecondToTime(sec int64) time.Time {
return time.Unix(sec, 0)
}
func NanosecondToTime(nanoseconds int64) time.Time {
seconds := int64(time.Second)
sec := nanoseconds / seconds
nsec := nanoseconds % seconds
return time.Unix(sec, nsec)
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/quant1x/gox.git
git@gitee.com:quant1x/gox.git
quant1x
gox
gox
v1.18.3

Search

344bd9b3 5694891 D2dac590 5694891