Automatically convert datetime to int64 #1715

Merged
lunny merged 2 commits from lunny/convert_datetime into master 2021-01-05 03:04:30 +00:00
Owner

Fix #1714

Fix #1714
lunny added this to the 1.0.3 milestone 2020-06-16 09:57:45 +00:00
lunny added the
kind
enhancement
label 2020-06-16 09:57:57 +00:00
jerry approved these changes 2020-06-16 10:04:39 +00:00
Dismissed
@ -170,2 +170,3 @@
} else {
x, err = strconv.ParseInt(sdata, 10, 64)
if col.SQLType.Name == schemas.DateTime {
if len(sdata) == 20 {
Member

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

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

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

这个地方,即使满足 len = 19 ,我急着出来的时间,中间也带个 T
lunny marked this conversation as resolved
@ -172,0 +184,4 @@
} else {
x, err = strconv.ParseInt(sdata, 10, 64)
}
} else {
Member

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

这个 else ,跟上面的有点重复了
lunny modified the milestone from 1.0.3 to 1.0.4 2020-07-10 12:52:31 +00:00
lunny modified the milestone from 1.0.4 to 1.0.5 2020-08-31 08:08:17 +00:00
lunny modified the milestone from 1.0.5 to 1.0.6 2020-09-08 15:40:39 +00:00
lunny added 2 commits 2021-01-05 03:03:42 +00:00
Some checks reported errors
continuous-integration/drone/push Build was killed
continuous-integration/drone/pr Build was killed
4ee1cf251f
Fix another time format
lunny merged commit 8284e5defa into master 2021-01-05 03:04:23 +00:00
lunny deleted branch lunny/convert_datetime 2021-01-28 03:07:44 +00:00
Sign in to join this conversation.
No description provided.