Automatically convert datetime to int64 #1715
No reviewers
Labels
No Label
backport/done
backport/v1
blocked
db
oracle
db
sqlserver
duplicate
feature
cache
frontport/done
frontport/main
invalid
kind
breaking
kind
bug
kind
build
kind
dependencies
kind
docs
kind
driver
kind
enhancement
kind
feature
kind
performance
kind
proposal
kind
question
kind
refactor
kind
testing
need
feedback
need
test
proposal:accepted
RaspBerry Pi
regression
skip-changelog
upstream
wip
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/xorm#1715
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "lunny/convert_datetime"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fix #1714
@ -170,2 +170,3 @@
} else {
x, err = strconv.ParseInt(sdata, 10, 64)
if col.SQLType.Name == schemas.DateTime {
if len(sdata) == 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)
这个地方,即使满足 len = 19 ,我急着出来的时间,中间也带个 T
@ -172,0 +184,4 @@
} else {
x, err = strconv.ParseInt(sdata, 10, 64)
}
} else {
这个 else ,跟上面的有点重复了