verochka/date/date.go

12 lines
230 B
Go
Raw Normal View History

2022-03-05 18:02:55 +00:00
package date
import "time"
2023-01-10 19:00:07 +00:00
func Today(offset time.Duration) string {
2022-09-04 12:54:04 +00:00
location, err := time.LoadLocation("Asia/Novosibirsk")
if err != nil {
panic(err)
}
2023-01-10 19:00:07 +00:00
return time.Now().In(location).Add(offset).Format("2006-01-02")
2022-03-05 18:02:55 +00:00
}