Skip to content

Commit dc7518b

Browse files
committed
rm use of round in validate range funcs for specific types
1 parent a9aaff2 commit dc7518b

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

sql/types/datetime.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,6 @@ func ValidateTime(t time.Time) interface{} {
476476
// ValidateDatetime receives a time and returns either that time or nil if it's
477477
// not a valid datetime.
478478
func ValidateDatetime(t time.Time) interface{} {
479-
t = t.Round(time.Microsecond)
480479
if t.Before(datetimeTypeMinDatetime) || t.After(datetimeTypeMaxDatetime) {
481480
return nil
482481
}
@@ -486,7 +485,6 @@ func ValidateDatetime(t time.Time) interface{} {
486485
// ValidateTimestamp receives a time and returns either that time or nil if it's
487486
// not a valid timestamp.
488487
func ValidateTimestamp(t time.Time) interface{} {
489-
t = t.Round(time.Microsecond)
490488
if t.Before(datetimeTypeMinTimestamp) || t.After(datetimeTypeMaxTimestamp) {
491489
return nil
492490
}
@@ -496,7 +494,6 @@ func ValidateTimestamp(t time.Time) interface{} {
496494
// validateDate receives a time and returns either that time or nil if it's
497495
// not a valid date.
498496
func ValidateDate(t time.Time) interface{} {
499-
t = t.Round(time.Microsecond)
500497
if t.Before(datetimeTypeMinDate) || t.After(datetimeTypeMaxDate) {
501498
return nil
502499
}

0 commit comments

Comments
 (0)