MCPcopy Create free account
hub / github.com/devfeel/mapper / UnixToTimeLocation

Function UnixToTimeLocation

convert.go:227–234  ·  view source on GitHub ↗

UnixToTimeLocation transform Unix time to local Time with time location location like "Asia/Shanghai"

(tt int64, location string)

Source from the content-addressed store, hash-verified

225// UnixToTimeLocation transform Unix time to local Time with time location
226// location like "Asia/Shanghai"
227func UnixToTimeLocation(tt int64, location string) (time.Time, error) {
228 loc, err := time.LoadLocation(location)
229 if err != nil {
230 return time.Now(), err
231 }
232 time.Local = loc
233 return time.Unix(tt, 0), nil
234}

Callers 1

setFieldValueMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…