I am making an application just for learning purpose. And I tried to calculate the difference between two dates
LocalDate today = LocalDate.now();
LocalDate localHoudbaarheid = houdbaarheidsDatum;
Period period = Period.between(today, localHoudbaarheid);
The calculation works, but the output is strange.
Output of the code:
Dagen tot over de datum: P9D
The only thing that should be shown is the 9 without the P and D. This is where I call the name period in my code to print it out:
"Dagen tot over de datum: " + period;