使用Get()方法单独获取时间会引起奔溃 #644

Open
opened 2017-07-17 16:34:47 +00:00 by Delveshal · 2 comments
Delveshal commented 2017-07-17 16:34:47 +00:00 (Migrated from github.com)

var c time.Time
models.Db.Table("table").Where("name = ?", name).Cols("created").Get(&c)
直接获取结构体并提取其中时间字段没有问题

var c time.Time models.Db.Table("table").Where("name = ?", name).Cols("created").Get(&c) 直接获取结构体并提取其中时间字段没有问题

当前并没有对时间进行支持

当前并没有对时间进行支持
gosp commented 2017-09-08 03:39:19 +00:00 (Migrated from github.com)

@Delveshal Maybe you define string type and Get its value, then convert it from string to time.Time.

@Delveshal Maybe you define `string` type and `Get` its value, then convert it from `string` to `time.Time`.
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
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: xorm/xorm#644
No description provided.