How to Remove year(yyyy) in date(dd/mm/yyyy)

  • A+

I have below dates,

24/04/2019  13/05/2019  12/04/2019 

I want to remove the year and convert these dates into following format,

24/04  13/05  12/04 

This not for output only I want to perform addition or apply for loop on that date.


You can get the substring from index 0 to 4:

String input = "24/04/2019"; String output = input.substring(0, 5); 


:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: