datediff tag
This tag calculates the difference between two dates and stores the properties (years, months, days, hours, minutes, seconds, and past) into the render engine for display by referencing the designated variable name. If no start-date is provided, the server date/time will be used for comparison. past is a boolean, true means the end date is in the past compared to the start date.
Attribute |
Notes |
name
|
Required
|
endDate
|
Required
|
startDate
|
|
test
|
|
pattern
|
|
Sample:
<c:datediff name="date" endDate="01-01-2014"/>
Years: ${date.years}
Hours: ${date.hours}