简体   繁体   中英

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.

日期算术的joda-time和人性化显示的漂亮时间

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

But I'd do the processing in a Controller and output only data in the JSP.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM