[GH-ISSUE #344] [BUG] 邮件入库时间时区设置 #115

Closed
opened 2026-02-26 20:35:44 +03:00 by kerem · 2 comments
Owner

Originally created by @o2asdv on GitHub (Jul 10, 2024).
Original GitHub issue: https://github.com/dreamhunter2333/cloudflare_temp_email/issues/344

复现步骤

目前看收邮件时,”raw_mails“表的”created_at“字段应该是邮件的实际发送时区的时间。

预期行为

能否在入库时,根据ENV的配置,将相应的时间转换为用户要求的时间进行存入。

需求原因

由于我使用的域名在中国大陆地区无法被正常解析使用,所以我用golang写了个定时将D1数据库内容读取到本地MySQL数据库的工具,同步时,可以设置增量同步(按收件时间),所以需要通过”created_at“字段在SELECT时进行过滤。

Originally created by @o2asdv on GitHub (Jul 10, 2024). Original GitHub issue: https://github.com/dreamhunter2333/cloudflare_temp_email/issues/344 ## 复现步骤 目前看收邮件时,”raw_mails“表的”created_at“字段应该是邮件的实际发送时区的时间。 ## 预期行为 能否在入库时,根据ENV的配置,将相应的时间转换为用户要求的时间进行存入。 ## 需求原因 由于我使用的域名在中国大陆地区无法被正常解析使用,所以我用golang写了个定时将D1数据库内容读取到本地MySQL数据库的工具,同步时,可以设置增量同步(按收件时间),所以需要通过”created_at“字段在SELECT时进行过滤。
kerem closed this issue 2026-02-26 20:35:44 +03:00
Author
Owner

@dreamhunter2333 commented on GitHub (Jul 10, 2024):

感谢反馈,数据库中 created_at 是 UTC 时间

created_at DATETIME DEFAULT CURRENT_TIMESTAMP
<!-- gh-comment-id:2220448256 --> @dreamhunter2333 commented on GitHub (Jul 10, 2024): 感谢反馈,数据库中 `created_at` 是 UTC 时间 created_at DATETIME DEFAULT CURRENT_TIMESTAMP
Author
Owner

@o2asdv commented on GitHub (Jul 10, 2024):

收到,谢谢,我这边调整下代码。

<!-- gh-comment-id:2220503193 --> @o2asdv commented on GitHub (Jul 10, 2024): 收到,谢谢,我这边调整下代码。
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cloudflare_temp_email#115
No description provided.