The java language The ideas is simple I have an now_date and I have pub_date I want to calculate the time between it and put the information in the following way:
if it's a few minutes "6 min ago"
if it's a few hours "6 hours ago"
if it's more than 24 hours "yesterday"
if it is more than 48 hours "on sun 25"
if it is more of the days of the week "last week"
if it's more than a year "2017 jun"
If there is a library or method to make it simpler, they would help me a lot by the time I compare them manually from year to year, month to month, day to day, etc.etc. But it is not reliable in this way since with biceset years it fails me.