We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3dfb20d commit 33c1744Copy full SHA for 33c1744
modules/timeutil/timestamp.go
@@ -54,6 +54,11 @@ func (ts TimeStamp) AsTime() (tm time.Time) {
54
return ts.AsTimeInLocation(setting.DefaultUILocation)
55
}
56
57
+// AsLocalTime convert timestamp as time.Time in local location
58
+func (ts TimeStamp) AsLocalTime() time.Time {
59
+ return time.Unix(int64(ts), 0)
60
+}
61
+
62
// AsTimeInLocation convert timestamp as time.Time in Local locale
63
func (ts TimeStamp) AsTimeInLocation(loc *time.Location) (tm time.Time) {
64
tm = time.Unix(int64(ts), 0).In(loc)
0 commit comments