Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

converting a PTP (Precision Time Protocol) string into a date and time?

Does anyone have experience converting a PTP (Precision Time Protocol) string into a date and time? Here are a few examples of the values that are coming in from the data source.


1504720821967

1504720822401

1504720875154

1504720875420

1504720880194

1504720880195

1504720896241

1504720896519

1504720896520

1504720905016

1504720905283

1504721314762

1504721314775

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Then specify it even if the script, if you want (applications will be heavier):

Date(Date#('01.01.1970', 'DD.MM.YYYY') + PTPTimestampField/86400/1000, 'MM/DD/YYYY hh:mm:ss.fff') AS Timestamp

View solution in original post

7 Replies
Anil_Babu_Samineni

What date format it should be for 1504720821967??

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Miguel_Angel_Baeyens

Something like this should work, but you will need to tweak the divisor depending on the precision of those timestamps (I'm assuming 1000, could be higher):

Date(Date#('01.01.1970', 'DD.MM.YYYY') + PTPTimestampField/86400/1000) AS Timestamp

EDIT: divisor separated for clarity

Anonymous
Not applicable
Author

i want in the following format : 'MM/DD/YYYY '

Anonymous
Not applicable
Author

let me try this

Miguel_Angel_Baeyens

Then specify it even if the script, if you want (applications will be heavier):

Date(Date#('01.01.1970', 'DD.MM.YYYY') + PTPTimestampField/86400/1000, 'MM/DD/YYYY hh:mm:ss.fff') AS Timestamp

Anil_Babu_Samineni

That is okay, Please provide output you want to see for that date row if you aware the result

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Anonymous
Not applicable
Author

Thanks a lot saver of the day