fix(c2c-bot): 水单完成时间转换为北京时间 (UTC+8)
问题:水单上的完成时间显示 UTC 时间(如 03:38:40),实际北京时间为 11:38:40。 原因:toISOString() 始终返回 UTC 时间。 修复:手动加 8 小时偏移量,将 UTC 转换为北京时间后再格式化。 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
bf11a269a4
commit
14e70b56bb
|
|
@ -40,7 +40,9 @@ export class PaymentProofService {
|
|||
}
|
||||
|
||||
private buildSvg(data: ProofData): string {
|
||||
const time = data.completedAt.toISOString().replace('T', ' ').slice(0, 19);
|
||||
// toISOString() 返回 UTC,手动加 8 小时转北京时间
|
||||
const beijingDate = new Date(data.completedAt.getTime() + 8 * 60 * 60 * 1000);
|
||||
const time = beijingDate.toISOString().replace('T', ' ').slice(0, 19);
|
||||
|
||||
return `<svg xmlns="http://www.w3.org/2000/svg" width="600" height="420">
|
||||
<defs>
|
||||
|
|
|
|||
Loading…
Reference in New Issue