Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Human friendly date logic library in java

So a question, is there a library out there that will allow me to do some datetime logic in human friendly format? For example, if I want to check if given date is within next month then I'll query submit if statement ${date} <= now + 1 month and it'll return true/false. The basic idea is do design jsp tag or function for el to do date operations and display sections of data 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 easy to change/read arithmetic lexicon.

Thanks in advance.

like image 535
Daniil Avatar asked Dec 21 '22 17:12

Daniil


1 Answers

joda-time for date arithmetic and pretty-time for human friendly display

like image 137
Aravind Yarram Avatar answered Jan 05 '23 00:01

Aravind Yarram