Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Using Formcalc to calculate Days between Dates

Avatar

Former Community Member

Can anyone give me a simple FormCalc script in which an end date is subtracted from a start date and the result is expressed in number of days?  I'm using LiveCycle Designer ES (not ES2).  Thank you!

1 Reply

Avatar

Employee

Use the following FormCalc script:

var numDays;

numDays = Date2Num("21/5/2012", "DD/M/YYYY") - Date2Num("19/5/2012", "DD/M/YYYY");

For more details on FormCalc scripting, pelase refer to: http://help.adobe.com/en_US/livecycle/es/FormCalc.pdf