angel96 / Design-Testing1

0 stars 1 forks source link

[Bug] Generar ticker de forma automatica #50

Closed angel96 closed 5 years ago

angel96 commented 5 years ago
SimpleDateFormat formato = new SimpleDateFormat("yyyy/MM/dd");

Date d = new Date();

String formated = formato.format(d).replace("/", "");

Character[] ch = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
    'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' };

String c = "";

Random random = new Random();

for (int i = 0; i < 6; i++) {
  c += ch[random.nextInt(ch.length)];
}

System.out.println(formated+"-"+c);
angel96 commented 5 years ago

Falta implementarlo en una clase utiles en el proyecto.

angel96 commented 5 years ago

Implementado. Cierro la issue.