UnixToTimeLocation transform Unix time to local Time with time location location like "Asia/Shanghai"
(tt int64, location string)
| 225 | // UnixToTimeLocation transform Unix time to local Time with time location |
| 226 | // location like "Asia/Shanghai" |
| 227 | func 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 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…