fix: 按业务时区同步昨日账单

- 固定按 Asia/Shanghai 计算账单昨日日期

- 补充 UTC 服务器时区回归测试
This commit is contained in:
Logan.Li committed 2026-07-29 05:57:07 +08:00
1 parent dd3770a66c
commit 65e2f09b97
2 files changed
+24 -1

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
package billingsync
import (
"testing"
"time"
)
// TestBillingYesterdayAt 验证 UTC 服务器按中国业务时区计算昨日。 // Logan.Li
func TestBillingYesterdayAt(t *testing.T) {
now := time.Date(2026, 7, 28, 21, 30, 0, 0, time.UTC)
if got := billingYesterdayAt(now); got != "2026-07-28" {
t.Fatalf("昨日日期错误: got=%s want=2026-07-28", got)
}
}