Is there simple way to convert time interval (age) to text?
For example – age is 25.45y. I need conversion to “25 years, 3 months, 1 day“. Question is not about numbers 25,3,1 but how to translate year/month/day using correct form (plural, declension) to different languages. English language seems to be easy to hardcode but others are not and I would prefer some generic solution.
number / English / Czech / …
1 / day / den
2 / days / dny
5 / days / dnů
…
Joda time will do that pretty easily.
For example:
Will print:
See also: Period to string