aboutsummaryrefslogtreecommitdiff
path: root/exp
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <anhgelus@anhgelus.world>2025-08-18 13:56:32 +0200
committerAnhgelus Morhtuuzh <anhgelus@anhgelus.world>2025-08-18 13:56:32 +0200
commit026abcc07a57eeda8a08a746ad2b664e956360f3 (patch)
treea5705ceb2b192c9ee18c4cce575a2251e3b72d1d /exp
parentcf2093095e769cdfac7fd83adc61d7ff6e958c0a (diff)
feat(xp): increase precision of timestamp
seems like to fix periodic reducer not working
Diffstat (limited to 'exp')
-rw-r--r--exp/functions.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/exp/functions.go b/exp/functions.go
index 026eb34..c20e6a8 100644
--- a/exp/functions.go
+++ b/exp/functions.go
@@ -50,14 +50,14 @@ func LevelXP(level uint) uint {
// TimeStampNDaysBefore returns the timestamp (year-month-day) n days before today
func TimeStampNDaysBefore(n uint) string {
- var y, d int
- var m time.Month
+ var unix time.Time
if gokord.Debug {
- y, m, d = time.Unix(time.Now().Unix()-int64(24*60*60), 0).Date() // reduce time for debug
+ unix = time.Unix(time.Now().Unix()-int64(n), 0) // reduce time for debug
} else {
- y, m, d = time.Unix(time.Now().Unix()-int64(n*24*60*60), 0).Date()
+ unix = time.Unix(time.Now().Unix()-int64(n*24*60*60), 0)
}
- return fmt.Sprintf("%d-%d-%d", y, m, d)
+ unix = unix.UTC()
+ return fmt.Sprintf("%d-%d-%d %d:%d:%d UTC", unix.Year(), unix.Month(), unix.Day(), unix.Hour(), unix.Minute(), unix.Second())
}
func TrimMessage(s string) string {