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

xorm combines carbon to write creation time? How to write it? #183

Closed
yoorxee opened this issue Sep 12, 2023 · 3 comments
Closed

xorm combines carbon to write creation time? How to write it? #183

yoorxee opened this issue Sep 12, 2023 · 3 comments
Labels
Question Indicates that an issue, pull request, or discussion needs more information

Comments

@yoorxee
Copy link

yoorxee commented Sep 12, 2023

数据表结构体是这样的
CreatedAt carbon.Time json:"created_at"``

carbon.Time 我再insert的时候,怎么写一个当前时间的carbon.Time类型? 怎么写呢?

@yoorxee yoorxee added the Question Indicates that an issue, pull request, or discussion needs more information label Sep 12, 2023
@Issues-translate-bot Issues-translate-bot changed the title xorm 结合 carbon 写入创建时间? 怎么写呢? xorm combines carbon to write creation time? How to write it? Sep 12, 2023
@Issues-translate-bot
Copy link
Collaborator

The issue body's language is not English, translate it automatically, please use English next time. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


The data table structure is like this
CreatedAt carbon.Time json:"created_at"``

carbon.Time When I insert again, how can I write a carbon.Time type of the current time? How to write it?

@gouguoyin
Copy link
Collaborator

Under what circumstances should only hours, minutes and seconds be stored?

@gouguoyin
Copy link
Collaborator

v2.2.8 added Time struct and ToTimeStruct method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Indicates that an issue, pull request, or discussion needs more information
Projects
None yet
Development

No branches or pull requests

3 participants