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

2019-06-19 Go、Gorm 与 MySQL timestamp - Go 夜读 #418

Closed
yangwenmai opened this issue Jun 19, 2019 · 3 comments
Closed

2019-06-19 Go、Gorm 与 MySQL timestamp - Go 夜读 #418

yangwenmai opened this issue Jun 19, 2019 · 3 comments

Comments

@yangwenmai
Copy link
Member

https://reading.developerlearning.cn/discuss/2019-06-19-gorm-mysql-timestamp/

Night Reading Go - Go source reading and offline technical discussion every Thursday night.

@awkj
Copy link

awkj commented Jun 19, 2019

我个人习惯使用 time.Unix(0,0) 来当作 datetime 类型,插入 1970-01-01 08:00:00 用的时候不实用 time.IsZero() 而是自己实现一个 IsZero() 方法来判断,只要不真的需要 1970 的状态,大多数时候也ok了

@acynothia
Copy link

2038 年也不远了, mysql 5.7 以后 timestamp 还是用 int32 是不是不太好。

@itcuihao
Copy link
Contributor

2038 年也不远了, mysql 5.7 以后 timestamp 还是用 int32 是不是不太好。

@Astone-Chou 哈哈,确实不远了,不过到时候也会有相应对策吧,比如再加一位,那也比datetime在空间上小呀。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

4 participants