问题
I'm looking for a taglib to use for calculating how many seconds there was between two dates.
回答1:
You just do that with EL:
<jsp:useBean id="now1" class="java.util.Date" />
<jsp:useBean id="now2" class="java.utli.Date" />
The difference is: ${now1.time/1000) - (now2.time/1000)}
That's just a simple compilable example -- in real life, the two dates would hold different values.
来源:https://stackoverflow.com/questions/5820248/looking-for-jstl-taglib-calculate-seconds-between-two-dates