This content has been marked as final. Show 4 replies
Here is an article that can help you with this-
( that is Part 1 of a series of 3 articles on working with dates and time in Acrobat- the others should be helpful too.)
Hope this helps,
Wow, this stuff is full on !!!
I've come up with the following, which doesn't work, i know it'll be something i'm doing wrong, can you take a look at it for me?
----- form1.#subform.TotalDays::calculate - (FormCalc, client) ----------------------------------
var strStart = this.getField("DateIn").value;
var strEnd = this.getField("DateOut").value;
if(strStart.length & strEnd.length)
var dateIn = util.scand("d/MM/YY",strStart);
var dateOut = util.scand("d/MM/YY",strEnd);
var diff = dateout.getTime() - datein.getTime();
var oneDay = 24 * 60 * 60 * 1000;
var days = Math.floor(diff/oneDay);
event.value = days;
event.value = 0;
You need at least two digits in your day format "DD/MM/YY".
I prefer to use 4 digit years because of the change in the millennium.