1
When I use this code:
Date data = new Date();
SimpleDateFormat formatador = new SimpleDateFormat("dd/MM/yyyy");
int dataAtual = Integer.parseInt(formatador.format(data));
System.out.println(dataAtual);
This error appears:
Exception in thread "main" java.lang.NumberFormatException: For input string: "15/09/2017" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Integer.parseInt(Integer.java:580) at java.lang.Integer.parseInt(Integer.java:615)
I believe it is because in Date format there are bars and they are not directly converted to whole, but I do not know how to make this conversion.
my mistake was very silly ahahahah thank you
– Mari Teixeira
that nothing, error is error :P
– rLinhares