code: func EncodeMySQLTime(sc *stmtctx.StatementContext, d types.Datum, tp byte, b []byte) (_ []byte, err error) {
  	t := d.GetMysqlTime()
  	// Encoding timestamp need to consider timezone. If it's not in UTC, transform to UTC first.
  	// This is compatible with `PBToExpr > convertTime`, and coprocessor assumes the passed timestamp is in UTC as well.
  	if tp == mysql.TypeUnspecified {
  		tp = t.Type
  	}
  	if tp == mysql.TypeTimestamp && sc.TimeZone != time.UTC {
  		err = t.ConvertTimeZone(sc.TimeZone, time.UTC)
  		if err != nil {
  			return nil, err
  		}
  	}
  	var v uint64
  	v, err = t.ToPackedUint()
  	if err != nil {
  		return nil, err
  	}
  	b = EncodeUint(b, v)
  	return b, nil
  }
docs: // EncodeMySQLTime encodes datum of `KindMysqlTime` to []byte.