Quantcast
Channel: Adobe Community : Popular Discussions - LiveCycle Forms
Viewing all articles
Browse latest Browse all 61369

Calculate Difference in Days Between two Dates

$
0
0

Hi,

 

I'm trying to figure out how to calculate the difference in days between two dates using JavaScript in LiveCycle. (JavaScript knowledge = minimal)

 

Where "Start_Date" and "Current_Date" are the names of the two dates in the Hierarchy palette. (both Date/Time Field)

*Current date is using the Object > Value > Runtime Property > Current Date/Time

 

I need a Text or Numeric field displaying the difference in days. (Difference_in_Days)

 

I've noticed the following code being pretty standard amongst other responses:

 

var

 

Start_Date =new Date(Start_Date);

var

 

Current_Date =new Date(Current_Date);

 

var

 

nAgeMilliseconds = Current_Date.getTime() - Start_Date.getTime();

 

var

 

nMilliSecondsPerYear = 365 * 24 * 60 * 60 * 1000;

 

 

I know there's code missing, and the above code might not be correct.

Please advise.


Viewing all articles
Browse latest Browse all 61369

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>