Calculating time difference

2 followers
0
Avatar

Hi,

I am trying to calculate the difference between two times. Both variables are currently stored as string. So I'm assuming I need to convert from string to time. How do I do this please? And then I will apply the subtract function.

Baz

 

 

Baz

3 comments

  • Avatar
    Baz

    Thanks Alan. This is a time not a date but does the ASDATE function still apply here?  

    0
  • Avatar
    Alan Mark

    Hi Baz,

    Yes all dates are calculated from epoch time, in milliseconds and then displayed according to their parse pattern.

    If the data only includes a timestamp, and not the full date, you'll need to add a datestamp to it with a concatenation function first.

    This, of course, assumes the timestamps are all from the  same day.  Since without a full datestamp you can't tell if two timestamps are separated by multiple days.  12:00pm and 12:01pm can look like a 1 minute difference, but if the two timestamps occur on separate days, we're dealing with 24 hours and 1 minute now.

    Alan

    0
Please sign in to leave a comment.