Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Correcting interaction Time

Please assist in converting this to the correct time. interaction time will be seconds to minutes etc.Screenshot 2022-07-06 at 17.30.39.png

0 7 197
7 REPLIES 7

Hi, I can see that you need help correcting interaction time, but could you please provide / share what you have tried so far, so we can provide tips or a guide to help? Also, in which data format are you fetching the interaction time, and would you want it to be a date, or just the time?

I have tried the data type changes for interaction_time and this is what i get, see screenshot.

Floodlight_Configuration would be something similar, I applied the same formula(see screen shot).

What is the nature of the field "interaction_time"?  Where does it come from?  What do you know about its value?  (for example, it is meant to be a timestamp or a duration)?

It is coming from Google Campaign Manager(https://developers.google.com/doubleclick-advertisers/dtv2/reference/file-format). It is suppose to a duration.

Aha ... thank you for the response.  That is perfect!!  I looked at the reference you sent and found "interaction time".  Its content is described as a string and is a numeric value (string encoded) that is the number of microseconds (Wow ... not milliseconds) since the epoch (1970-01-01T00:00:00).  This matches what we see in the following website:

https://www.epochconverter.com/

1653479147719 would be May 25, 2022 at 11:45:47.719 (plus 599 u-secs)

so this means its NOT an interval but instead an absolute fine grained timestamp.   Does this change your understanding now that we see it as a timestamp and not an interval?  We would never want to convert this to duration, but rather to a definite point in time.

Thank you. From the link I sent you, there are some time logs. How will i correct such as a time log?

I don't have a CDAP or Data Fusion environment to hand to test.  My first pass would be to set the column type of interaction_time to date.  My fear is that won't immediately work as the timestamp value seems to be microseconds.  If the date formatter expects an epoch time in milliseconds you may have to divide by 1000 first to convert to microseconds.