pre_test.go 458 B

1234567891011121314151617181920212223
  1. package main
  2. import (
  3. "fmt"
  4. "strconv"
  5. "testing"
  6. "time"
  7. )
  8. func TestMonth(T *testing.T) {
  9. // 创建2023年12月31日的时间对象
  10. date := time.Date(2023, time.August, 30, 0, 0, 0, 0, time.UTC)
  11. next := date.AddDate(0, -1, -1)
  12. month := int(next.Month())
  13. monthStr := strconv.Itoa(month)
  14. year := next.Year()
  15. yearStr := strconv.Itoa(year)
  16. //预处理索引名称
  17. PreBiddingIndex := "bidding_" + yearStr + monthStr
  18. fmt.Sprintf(PreBiddingIndex)
  19. }