mirror of
https://github.com/go-gitea/gitea
synced 2025-07-03 09:07:19 +00:00
Replace ServeStream
with ServeContent
(#20903)
* Replace ServeStream with ServeContent. * Update modules/timeutil/timestamp.go Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
@ -54,6 +54,11 @@ func (ts TimeStamp) AsTime() (tm time.Time) {
|
||||
return ts.AsTimeInLocation(setting.DefaultUILocation)
|
||||
}
|
||||
|
||||
// AsLocalTime convert timestamp as time.Time in local location
|
||||
func (ts TimeStamp) AsLocalTime() time.Time {
|
||||
return time.Unix(int64(ts), 0)
|
||||
}
|
||||
|
||||
// AsTimeInLocation convert timestamp as time.Time in Local locale
|
||||
func (ts TimeStamp) AsTimeInLocation(loc *time.Location) (tm time.Time) {
|
||||
tm = time.Unix(int64(ts), 0).In(loc)
|
||||
|
Reference in New Issue
Block a user