Skip to content

Commit fcea447

Browse files
committed
Round under microsecond
1 parent c285e39 commit fcea447

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

connection.go

+1
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ func (mc *mysqlConn) interpolateParams(query string, args []driver.Value) (strin
252252
buf = append(buf, "'0000-00-00'"...)
253253
} else {
254254
v := v.In(mc.cfg.loc)
255+
v = v.Add(time.Nanosecond * 500) // To round under microsecond
255256
year := v.Year()
256257
year100 := year / 100
257258
year1 := year % 100

0 commit comments

Comments
 (0)