backend/pkg/utils/time.go

14 lines
274 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package utils
import "time"
// GetBucketDay 取得 bucket_dayyyyyMMdd 格式)
func GetBucketDay(t time.Time) string {
return t.Format("20060102")
}
// GetTodayBucketDay 取得今天的 bucket_day
func GetTodayBucketDay() string {
return GetBucketDay(time.Now())
}