code: func goTimeToMysqlUnixTimestamp(t time.Time, decimal int) (*types.MyDecimal, error) {
  	nanoSeconds := t.UnixNano()
  	if nanoSeconds < 0 || (nanoSeconds/1e3) >= (math.MaxInt32+1)*1e6 {
  		return new(types.MyDecimal), nil
  	}
  	dec := new(types.MyDecimal)
  	// Here we don't use float to prevent precision lose.
  	dec.FromInt(nanoSeconds)
  	err := dec.Shift(-9)
  	if err != nil {
  		return nil, err
  	}
  
  	// In MySQL's implementation, unix_timestamp() will truncate the result instead of rounding it.
  	// Results below are from MySQL 5.7, which can prove it.
  	//	mysql> select unix_timestamp(), unix_timestamp(now(0)), now(0), unix_timestamp(now(3)), now(3), now(6);
  	//	+------------------+------------------------+---------------------+------------------------+-------------------------+----------------------------+
  	//	| unix_timestamp() | unix_timestamp(now(0)) | now(0)              | unix_timestamp(now(3)) | now(3)                  | now(6)                     |
  	//	+------------------+------------------------+---------------------+------------------------+-------------------------+----------------------------+
  	//	|       1553503194 |             1553503194 | 2019-03-25 16:39:54 |         1553503194.992 | 2019-03-25 16:39:54.992 | 2019-03-25 16:39:54.992969 |
  	//	+------------------+------------------------+---------------------+------------------------+-------------------------+----------------------------+
  	err = dec.Round(dec, decimal, types.ModeTruncate)
  	return dec, err
  }
docs: // goTimeToMysqlUnixTimestamp converts go time into MySQL's Unix timestamp.
  // MySQL's Unix timestamp ranges in int32. Values out of range should be rewritten to 0.