none
Subtracting timestamps which include milliseconds RRS feed

  • Question

  • Hello all,

    I have application log files with timestamp that include milliseconds in the format hh:mm:ss.000

    I need to substract start/finish timestamps but cannot find a format Powerquery likes in handle the milliseconds.

    Can anyone recommend a solution.

    Thanks, Ben

    Tuesday, October 27, 2015 10:38 AM

Answers

  • Just convert them to Time and subtract them. Even though PQ doesn't display the milliseconds in the preview table, if you click on a cell you'll see the full value is still there. Subtracting two Times results in a Duration, which can be used for further calculations.

    Ehren



    Wednesday, October 28, 2015 11:44 PM
    Owner

All replies

  • Have you tried Duration?
    Wednesday, October 28, 2015 1:45 PM
  • Just convert them to Time and subtract them. Even though PQ doesn't display the milliseconds in the preview table, if you click on a cell you'll see the full value is still there. Subtracting two Times results in a Duration, which can be used for further calculations.

    Ehren



    Wednesday, October 28, 2015 11:44 PM
    Owner
  • I don't see Duration.Milliseconds function in https://msdn.microsoft.com/en-us/library/mt296613.aspx

    Keep involved!

    Monday, February 29, 2016 6:34 AM
  • If you use Duration.Seconds or Duration.TotalSeconds, you'll see the milliseconds represented as fractional seconds.

    For example:

    = Duration.Seconds(#duration(0,0,0,1.234))

    Results in:

    1.234

    Ehren

    Monday, February 29, 2016 6:33 PM
    Owner