Skip to main content

How to Subtract Time in K2 Smart Forms

  • 26 September 2017
  • 4 replies
  • 67 views

I have a list view where i capture employee's Time' In and Time Out at end of there shift. Both of those controls are of type Time. Once Values are Set, i would like to get time diffrence between timein and timeout. How can i do that, results needs to be stored in Time format?

 

Thank You 

4 replies

Badge +9

Did you look at the available Date and Time expression operators?  There's a "Date/Time Difference" function that would meet your need.

Date/Time Difference

Determines the difference between two dates, returning the difference in the specified interval with sub-intervals as decimal fractions. Intervals available: year, month, day, hour, minute, second and millisecond

Interval: Day
First Date: 01/01/2009  00:00:00 AM
Second Date: 01/02/2010 00:00:00 AM
Result: -366

source: https://help.k2.com/onlinehelp/k2smartforms/userguide/4.7/default.htm#sf-viewdesignerlayout-calcexpression.html

Badge +2

What is Interval on this case, what should by entry be, since i am looking to get Time returned?

Badge +9

Whatever you want... Your choices for time are hours, minutes, seconds and milliseconds.

Badge +2

Thanks that worked.

Reply