Human-logical date library in java

So the question is, is there a library there that will allow me to make some datetime logic in a human-friendly format? For example, if I want to check if the given date matches within the next month, I will ask to send if statement $ {date} <= now + 1 month, and it will return true / false. The main idea is to create a jsp tag or an el function to perform date operations and display data sections to the client:

<bla:cond test="${datetime} <= now + 1 month">within next month</bla:cond> <bla:cond test="${datetime} > now + 2 seconds && ${datetime} < now + 3 seconds">in 2 seconds</bla:cond> 

Something like that. The idea is to have some datetime logic with a simple replacement / reading of arithmetic vocabulary.

Thanks in advance.

+4
source share
2 answers

joda-time for date arithmetic and attractive time for individualistic display

+7
source

JodaTime usually comes to mind. It also has a JSP tag library .

But I would do the processing in the controller and output only the data in the JSP.

+3
source

Source: https://habr.com/ru/post/1341178/


All Articles