code: func builtinUnixTimestamp(args []types.Datum, ctx context.Context) (d types.Datum, err error) {
  	if len(args) == 0 {
  		now := time.Now().Unix()
  		d.SetInt64(now)
  		return
  	}
  
  	var (
  		t  types.Time
  		t1 time.Time
  	)
  	switch args[0].Kind() {
  	case types.KindString:
  		t, err = types.ParseTime(args[0].GetString(), mysql.TypeDatetime, types.MaxFsp)
  		if err != nil {
  			return d, errors.Trace(err)
  		}
  	case types.KindInt64, types.KindUint64:
  		t, err = types.ParseTimeFromInt64(args[0].GetInt64())
  		if err != nil {
  			return d, errors.Trace(err)
  		}
  	case types.KindMysqlTime:
  		t = args[0].GetMysqlTime()
  	default:
  		return d, errors.Errorf("Unkonwn args type for unix_timestamp %d", args[0].Kind())
  	}
  
  	t1, err = t.Time.GoTime(getTimeZone(ctx))
  	if err != nil {
  		d.SetInt64(0)
  		return d, nil
  	}
  
  	if t.Time.Microsecond() > 0 {
  		var dec types.MyDecimal
  		dec.FromFloat64(float64(t1.Unix()) + float64(t.Time.Microsecond())/1e6)
  		d.SetMysqlDecimal(&dec)
  	} else {
  		d.SetInt64(t1.Unix())
  	}
  	return
  }
docs: // See https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_unix-timestamp