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

Function safeUnixSeconds

middleware/cache/utils.go:110–117  ·  view source on GitHub ↗
(t time.Time)

Source from the content-addressed store, hash-verified

108}
109
110func safeUnixSeconds(t time.Time) uint64 {
111 sec := t.Unix()
112 if sec < 0 {
113 return 0
114 }
115
116 return uint64(sec)
117}
118
119func secondsToTime(sec uint64) time.Time {
120 var clamped int64

Callers 3

NewFunction · 0.85
parseHTTPDateFunction · 0.85

Calls

no outgoing calls

Tested by 1