Skip to content

Commit dc8dcfd

Browse files
committed
update
1 parent 7f9b38f commit dc8dcfd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

helpers.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"math"
55
"strconv"
66
"strings"
7+
"time"
78
"unicode"
89
)
910

@@ -144,3 +145,11 @@ func TSVSearch(str string) string {
144145
}
145146
return strings.Join(strings.Split(str, " "), ":* & ") + ":*"
146147
}
148+
149+
func TimeInLoc(t time.Time, loc string) (time.Time, error) {
150+
l, err := time.LoadLocation(loc)
151+
if err != nil {
152+
return t, err
153+
}
154+
return t.In(l), nil
155+
}

0 commit comments

Comments
 (0)