Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CreatedAt 等 time.Time 字段对外输出时格式化输出 #32

Open
nannan00 opened this issue May 28, 2024 · 0 comments
Open

CreatedAt 等 time.Time 字段对外输出时格式化输出 #32

nannan00 opened this issue May 28, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@nannan00
Copy link
Collaborator

目前 CreatedAt 等 time.Time 字段是直接 json 输出,默认是 RFC 3339 格式,但实际上会根据 time.Time 值的时区决定最终输出的字符串格式

  • 如果时间值是 UTC 时区,那么会以 "Z" 结尾,如 "2022-06-28T17:50:21Z"
  • 如果时间值设定了其他时区,输出将包含相应的偏移量,如 "2023-05-18T15:04:05+01:00"

这样导致调用方需要做时区后的区分处理,应该以指定格式输出,不应该有多种格式

@nannan00 nannan00 added the enhancement New feature or request label May 28, 2024
@nannan00 nannan00 self-assigned this May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant