Calculating difference between two dates and times in hours<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />Iam trying to subtract two dates and times and get the answer in hours. For example
Column1 Column2
01/30/2013 5:30 02/02/2013 14:30
I want to subtract column1 from column2 and the difference in hours. I want to do this in JSL Scripting language... Can some one help how to subtract the above two dates..I mean the formula for doing that,.
Thanks a lot
Re: Calculating difference between two dates and times in hoursSame principle:
((:Column 4 + :Column 3) - (:Column 1 + :Column 2)) / 60 / 60
Re: Calculating difference between two dates and times in hoursBut the Date is one column and Time is in another column. Sorry, I represented my data wrong in the above example. It actually looks like
Column1 Column2 Column3 Column4
01/30/2013 5:30 02/02/2013 14:30
here column1 and column 2 is one set . Example, jan 30th 5:30 AM is represented by column 1 and column 2.
Feb 2nd 14:30 PM is represented by column 3 and column 4. Now I want to know how many hours are in between Feb 2nd 14:30 PM and Jan 30 5:30 AM.
Thanks,
Re: Calculating difference between two dates and times in hoursThe date/time value internally represents nr of seconds since a reference date. Simply substract the the columns and divide with 3600 to get the result in hours.
(:Column2-Column1)/60/60