From bbe13b60cdf93d8296f4c6dab624df2b571db234 Mon Sep 17 00:00:00 2001 From: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com> Date: Sat, 6 Jun 2020 00:51:10 +0200 Subject: Fix timezone on issue deadline (#11697) * Fix timezone on issue deadline * FormatDate Co-authored-by: zeripath --- modules/timeutil/timestamp.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules/timeutil') diff --git a/modules/timeutil/timestamp.go b/modules/timeutil/timestamp.go index f70da9db74..b1c60c3084 100644 --- a/modules/timeutil/timestamp.go +++ b/modules/timeutil/timestamp.go @@ -75,6 +75,11 @@ func (ts TimeStamp) FormatShort() string { return ts.Format("Jan 02, 2006") } +// FormatDate formats a date in YYYY-MM-DD server time zone +func (ts TimeStamp) FormatDate() string { + return time.Unix(int64(ts), 0).String()[:10] +} + // IsZero is zero time func (ts TimeStamp) IsZero() bool { return ts.AsTimeInLocation(time.Local).IsZero() -- cgit v1.2.3