I thank you for possible answers. The problem is, I work with a legacy system with Java 1.4. In a registration form you have the following fields: 'Period' in the mm / yyyy format 'Expiration Day' Concatenate the day with the period and parse for Date.
I need to handle the months with 29 for February and the months of 31 days. Putting 'Expiration Day' = 31, when it is February the parse plays for 03/01/2021 and in the months when it is not 31 the parse plays for the first day of the following month. I need that for these situations the parse takes the last day of the month and not the following month. I have already researched and did not see how to do it by parse itself.
DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
Date dataDebito = df.parse(31 + "/" + 02 + "/" + 2021); //February is not 31 and I need you to parse it for 2/28/2021 or 2/29/2021 if it was a leap year.