anurag hn
anurag hn

Reputation: 45

I am very new to velocity apache script

Present code is am using is like this:

#set($startdate=$datetool.format("yyyymmdd",$fromDate))

#set($enddate=$datetool.format("yyyymmdd",$endDate))

But I dont know how to continue. I want to find out difference between two dates which are in the format yyyymmdd, and if the difference is greater than one month, I have to divide that into months, so please anyone help to solve this.

Upvotes: 1

Views: 172

Answers (1)

soorapadman
soorapadman

Reputation: 4509

I Would suggest you to to use ComparisonDateTool in Velocity to get date difference

 $dateComparisonTool.difference($startdate,$enddate).days 

Upvotes: 1

Related Questions