2 Star 2 Fork 8

王布衣/gox

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
filestat.go 510 Bytes
一键复制 编辑 原始数据 按行查看 历史
王布衣 提交于 2024-02-14 09:56 +08:00 . 微调部分函数错误定义
package api
import (
"errors"
"time"
)
var (
ErrInvalidFileStat = 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)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/quant1x/gox.git
git@gitee.com:quant1x/gox.git
quant1x
gox
gox
v1.24.9

搜索帮助