Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Getting a new Timestamp

Hello all,
 
I'd like to hear opinions on this one.
 
I have a table including one timestamp (e.g. 11/29/2022 11:48:35 AM, type Date/Time), and one lapse of time in decimal minutes (e.g. 3.61 minutes, type Decimal number). The timestamp is the end of an event, and I need to find the timestamp where that event *started*. So basically I'd need to somehow get the time from the timestamp (11:48:35), substract timelapse (3.61 minutes, converted to 3:37) to get a new column with a new timestamp stating the beginning of that timelapse (which in this example should be 11:44:58).
 
How would one accomplish that?

3 Replies

  • v-zhangti's avatar
    v-zhangti
    Icon for Community Support rankCommunity Support

    Hi, Anonymous 

     

    Can you provide sample data for testing? Sensitive information can be removed in advance. What kind of expected results do you expect? You can also show it with pictures or Excel. I look forward to your response.

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Here is a sample. Again, first column is type date/time, second is decimal number. I would need to generate a third column containing another timestamp where the value is the first one minus the second one. E.g. for the first line in this table, the result would be 6/17/2022 1:42:51 (which is 1:49 minus 6 minutes 9 seconds).

       

      Thanks again.

      • Anonymous's avatar
        Anonymous
        Not applicable

        Replying to myself: I converted the second column to type duration, and put it in a new column. The results seem to be correct for amount of seconds (i.e. 6.16405 is returned as 369.843). I then extracted the time of the first column, and substracted the duration. The results I got were wildly inaccurate; some instances somehow interpreted substracting around 240 seconds to extracting almost a full hour, while others showed extracting 129 seconds gave as result something around 4 hours before the original time. I'm not sure I understand why.