Automatically convert datetime to int64 #1715

Merged
lunny merged 2 commits from lunny/convert_datetime into master 11 months ago
lunny commented 1 year ago
Owner

Fix #1714

Fix #1714
lunny added this to the 1.0.3 milestone 1 year ago
lunny added the
kind/enhancement
label 1 year ago
jerry approved these changes 1 year ago
Dismissed
} else {
x, err = strconv.ParseInt(sdata, 10, 64)
if col.SQLType.Name == schemas.DateTime {
if len(sdata) == 20 {
jerry commented 1 year ago
Collaborator

这个 20 估计不会满足,默认出来的时间,sdata 是 : 带 +8:00 的,不会满足 len() = 20这个条件,

这个 20 估计不会满足,默认出来的时间,sdata 是 : 带 +8:00 的,不会满足 len() = 20这个条件,
}
x = t.Unix()
} else if len(sdata) == 19 {
t, err := time.Parse("2006-01-02 15:04:05", sdata)
jerry commented 1 year ago
Collaborator

这个地方,即使满足 len = 19 ,我急着出来的时间,中间也带个 T

这个地方,即使满足 len = 19 ,我急着出来的时间,中间也带个 T
lunny marked this conversation as resolved
} else {
x, err = strconv.ParseInt(sdata, 10, 64)
}
} else {
jerry commented 1 year ago
Collaborator

这个 else ,跟上面的有点重复了

这个 else ,跟上面的有点重复了
lunny modified the milestone from 1.0.3 to 1.0.4 1 year ago
lunny modified the milestone from 1.0.4 to 1.0.5 1 year ago
lunny modified the milestone from 1.0.5 to 1.0.6 1 year ago
lunny added 2 commits 11 months ago
4ee1cf251f Fix another time format
lunny merged commit 8284e5defa into master 11 months ago
lunny deleted branch lunny/convert_datetime 10 months ago
continuous-integration/drone/push Build was killed
continuous-integration/drone/pr Build was killed
The pull request has been merged as 8284e5defa.
Sign in to join this conversation.
Loading…
There is no content yet.