diff --git a/sa/type-converter.go b/sa/type-converter.go index b746449cdf1..15250c50cd0 100644 --- a/sa/type-converter.go +++ b/sa/type-converter.go @@ -4,6 +4,7 @@ import ( "encoding/json" "errors" "fmt" + "time" "github.com/letsencrypt/borp" "gopkg.in/go-jose/go-jose.v2" @@ -34,6 +35,10 @@ func (tc BoulderTypeConverter) ToDb(val interface{}) (interface{}, error) { return string(t), nil case core.OCSPStatus: return string(t), nil + case time.Time: + // All of our MySQL DATETIME columns have only Second-level precision, so + // don't bother sending more precision than the database will use. + return t.Truncate(time.Second), nil default: return val, nil }