code: func calculateTimeDiff(sc *stmtctx.StatementContext, lhs, rhs types.Time) (d types.Duration, isNull bool, err error) {
  	d = lhs.Sub(sc, &rhs)
  	d.Duration, err = types.TruncateOverflowMySQLTime(d.Duration)
  	if types.ErrTruncatedWrongVal.Equal(err) {
  		err = sc.HandleTruncate(err)
  	}
  	return d, err != nil, err
  }
docs: // calculateTimeDiff calculates interval difference of two types.Time.