MCPcopy
hub / github.com/gofiber/fiber / secondsToTime

Function secondsToTime

middleware/cache/utils.go:119–128  ·  view source on GitHub ↗
(sec uint64)

Source from the content-addressed store, hash-verified

117}
118
119func secondsToTime(sec uint64) time.Time {
120 var clamped int64
121 if sec > uint64(math.MaxInt64) {
122 clamped = math.MaxInt64
123 } else {
124 clamped = int64(sec)
125 }
126
127 return time.Unix(clamped, 0).UTC()
128}
129
130func secondsToDuration(sec uint64) time.Duration {
131 const maxSeconds = uint64(math.MaxInt64) / uint64(time.Second)

Callers 3

NewFunction · 0.85

Calls

no outgoing calls

Tested by 2