Skip to main content
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??

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
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

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Thanks a lot saver of the day