Link to home
Start Free TrialLog in
Avatar of atljarman
atljarman

asked on

InfoPath Calculate Time Difference in Seconds on Web Form

Hi,

I found a form online that calculates the difference between two dates in hours and I can not figure out how to convert this to difference in minutes to two decimal places.  I've attached the form for the hour calculation
HourDifference.txt
Avatar of atljarman
atljarman

ASKER

This script works on a button on my form to calculate the differnce in days but I have no idea how to conver this to the difference in time in minutes:

(number(substring(dfs:dataFields/my:SharePointListItem_RW/my:End, 9, 2)) + floor((153 * (number(substring(dfs:dataFields/my:SharePointListItem_RW/my:End, 6, 2)) + 12 * (floor((14 - number(substring(dfs:dataFields/my:SharePointListItem_RW/my:End, 6, 2))) / 12)) - 3) + 2) / 5) + (number(substring(dfs:dataFields/my:SharePointListItem_RW/my:End, 1, 4)) + 4800 - (floor((14 - number(substring(dfs:dataFields/my:SharePointListItem_RW/my:End, 6, 2))) / 12))) * 365 + floor((number(substring(dfs:dataFields/my:SharePointListItem_RW/my:End, 1, 4)) + 4800 - (floor((14 - number(substring(dfs:dataFields/my:SharePointListItem_RW/my:End, 6, 2))) / 12))) / 4) - floor((number(substring(dfs:dataFields/my:SharePointListItem_RW/my:End, 1, 4)) + 4800 - (floor((14 - number(substring(dfs:dataFields/my:SharePointListItem_RW/my:End, 6, 2))) / 12))) / 100) + floor((number(substring(dfs:dataFields/my:SharePointListItem_RW/my:End, 1, 4)) + 4800 - (floor((14 - number(substring(dfs:dataFields/my:SharePointListItem_RW/my:End, 6, 2))) / 12))) / 400) - 32045) - (number(substring(dfs:dataFields/my:SharePointListItem_RW/my:Start, 9, 2)) + floor((153 * (number(substring(dfs:dataFields/my:SharePointListItem_RW/my:Start, 6, 2)) + 12 * (floor((14 - number(substring(dfs:dataFields/my:SharePointListItem_RW/my:Start, 6, 2))) / 12)) - 3) + 2) / 5) + (number(substring(dfs:dataFields/my:SharePointListItem_RW/my:Start, 1, 4)) + 4800 - (floor((14 - number(substring(dfs:dataFields/my:SharePointListItem_RW/my:Start, 6, 2))) / 12))) * 365 + floor((number(substring(dfs:dataFields/my:SharePointListItem_RW/my:Start, 1, 4)) + 4800 - (floor((14 - number(substring(dfs:dataFields/my:SharePointListItem_RW/my:Start, 6, 2))) / 12))) / 4) - floor((number(substring(dfs:dataFields/my:SharePointListItem_RW/my:Start, 1, 4)) + 4800 - (floor((14 - number(substring(dfs:dataFields/my:SharePointListItem_RW/my:Start, 6, 2))) / 12))) / 100) + floor((number(substring(dfs:dataFields/my:SharePointListItem_RW/my:Start, 1, 4)) + 4800 - (floor((14 - number(substring(dfs:dataFields/my:SharePointListItem_RW/my:Start, 6, 2))) / 12))) / 400) - 32045)
ASKER CERTIFIED SOLUTION
Avatar of atljarman
atljarman

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
solved my own question.
Solved my own solution.