hi there
I need to find the difference in minutes between 2 datetime fields that I have on a single form. I need to store the result in a field called mindiff.
startDateAndTime : the user enters the value in this field in the following format dd/mm/yyyy hh:mm
endDateAndTime : the user enters the value in this field in the following format dd/mm/yyyy hh:mm
How can I do this in Livecycle , either using formcalc or javascript ?
at the end i need to convert the date and the time into minutes and subtract date from time. is that possible?
i have all these fields in 1 tables in a subform and i'm using FormCalc.
thanks for your assistance. .
See this article:
http://acrobatusers.com/tutorials/2006/date_time_part2/
The sequence goes like this:
1. Use "util.scand()" to convert the formatted date/time text into a Date Object. This is the key part.
var oStartDate = util.scand("dd/mm/yyyy/ hh:MM", startDateAndTime.rawValue);
2. convert the Date object into milliseconds
3. convert milliseconds into minutes
4. compute difference
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script