Difference between two time stamp

Comments

1 comment

  • Avatar
    Shobhit Garg

    Hi Mita,

    To get the difference between two timestamps, you need to convert them into milliseconds first and then subtract them

    Something like below, you can choose the format as per your requirement, below is just and example.

    | toMillis(parseDate(Start_time, "yyyy-MM-dd'T'HH:mm:ssZZZZ"))) as Start_time_milli
    | itoMillis(parseDate(End_time, "yyyy-MM-dd'T'HH:mm:ssZZZZ"))) as End_time_milli
    | (End_time_milli - Start_time_milli)/1000 as Duration_sec

    Regards

     

    0
    Comment actions Permalink

Please sign in to leave a comment.