fix: 按业务时区同步昨日账单
- 固定按 Asia/Shanghai 计算账单昨日日期 - 补充 UTC 服务器时区回归测试
This commit is contained in:
1 parent
dd3770a66c
commit
65e2f09b97
2 files changed
+24
-1
No files matched your search
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user