Now here receive data in a format: date.month. How to change just for a year?

public String getSignByDate(String date) throws RemoteException { System.err.println(date); if (date.length() != 5) { return "Invalid date format"; } else { Integer day = Integer.parseInt(date.substring(0, 2)); Integer mounth = Integer.parseInt(date.substring(3)); String sign = this.getSign(day, mounth); return "sign is " + sign; } } 

    1 answer 1

    If we continue to parse further, the next value will be the year.

     Integer year = Integer.parseInt(date.substring(6));