code: func (t Time) ToNumber() *MyDecimal {
  	if t.IsZero() {
  		return &MyDecimal{}
  	}
  
  	// Fix issue #1046
  	// Prevents from converting 2012-12-12 to 20121212000000
  	var tfStr string
  	if t.Type == mysql.TypeDate {
  		tfStr = dateFormat
  	} else {
  		tfStr = numberFormat
  	}
  
  	s, err := t.DateFormat(tfStr)
  	if err != nil {
  		logutil.Logger(context.Background()).Error("[fatal] never happen because we've control the format!")
  	}
  
  	if t.Fsp > 0 {
  		s1 := fmt.Sprintf("%s.%06d", s, t.Time.Microsecond())
  		s = s1[:len(s)+t.Fsp+1]
  	}
  
  	// We skip checking error here because time formatted string can be parsed certainly.
  	dec := new(MyDecimal)
  	err = dec.FromString([]byte(s))
  	terror.Log(errors.Trace(err))
  	return dec
  }
docs: // ToNumber returns a formatted number.
  // e.g,
  // 2012-12-12 -> 20121212
  // 2012-12-12T10:10:10 -> 20121212101010
  // 2012-12-12T10:10:10.123456 -> 20121212101010.123456