update db and added weight
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-04-16 17:08:40 +07:00
parent 3f9447f0b8
commit 09fe5f2324
7 changed files with 86 additions and 25 deletions
+25 -3
View File
@@ -1,14 +1,36 @@
package times
import "time"
import (
"time"
)
var (
loc *time.Location
)
func init() {
loc, _ = time.LoadLocation("Asia/Novosibirsk")
}
func GetNow() time.Time {
t := time.Now().In(loc)
return t
}
func GetStartDay() time.Time {
loc, _ := time.LoadLocation("Asia/Novosibirsk")
t := time.Now().In(loc)
t := GetNow()
t = time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, loc)
return t
}
func GetStartDayMinus(days int) time.Time {
t := GetStartDay()
for i := 0; i < days; i++ {
t = t.Add(-24 * time.Hour)
}
return t
}
func GetStartWeek() time.Time {
t := GetStartDay()
t = t.Add(-6 * 24 * time.Hour)