This commit is contained in:
Gordon
2022-01-20 19:20:56 +08:00
parent 64f2fb9e73
commit 5a9f3f1f5e
2 changed files with 7 additions and 2 deletions
+5
View File
@@ -30,6 +30,11 @@ func UnixSecondToTime(second int64) time.Time {
func UnixNanoSecondToTime(nanoSecond int64) time.Time {
return time.Unix(0, nanoSecond)
}
func UnixMillSecondToTime(millSecond int64) time.Time {
sec := millSecond / 1000
msec := millSecond % 1000
return time.Unix(sec, msec*int64(time.Millisecond))
}
//Get the current timestamp by Nano
func GetCurrentTimestampByNano() int64 {