Calculation hours from a Start-Date and End-Date

Comments

4 comments

  • Ellen Boeke

    Hi Eric,

    This should do it for you:

    Math.abs((Start-Date.getTime() - End-Date.getTime())/3600000)

    Ellen

    0
    Comment actions Permalink
  • Paul Lyet

    Ellen.. Can you please explain this further. How do you define the equation? Cant seen to figure out how to reference the time field.

    0
    Comment actions Permalink
  • tuck

    Yes, this answer doesn't seem to work for me at all.
    I'm using the Calculation field. I have a Start Date and then an End Date field. However subtracting one from the other does nothing useful.

    0
    Comment actions Permalink
  • ESDC

    var d1 = moment(@Start Time);
    var d2 = moment(@End Time);
    var result = d2.diff(d1, 'hours');

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk