0

I have given the following timestamps from the phone sensors:

"355923662301978" "355924316842994" "355925061990699" "355925474832496" "355926632883033" "355927755655250" "355928223886451" "355928999246558" "355935032320419" "355935485475937"

I know the test was done a couple of days ago - mid+ September 2018.

Please help me, I am trying to build time series for FFT and these timestamps confusing me:

I am trying to perform as.POSIXct(timestamp, origin = "1970-01-01") but it gives me wrong date.

Maybe somebody knows how to treat these timestamps?

Summary:

Min.         1st Qu.          Median            Mean         3rd Qu.            Max. 
355923662301978 356090586666599 356391734517417 356351795341552 356570634137053 356857555046376 
SteveS
  • 3,789
  • 5
  • 30
  • 64
  • 2
    Experiment with different origins until you find the right one. If you search for the name of the sensor and something like "timestamp origin" you might be able to find the right answer. – Gregor Thomas Oct 20 '18 at 14:49
  • 2
    You probably also need to know the units of the timestamp. Are they seconds? Microseconds? – G5W Oct 20 '18 at 14:51
  • 2
    Yeah, the numbers seem too big for seconds to be plausible. What is the min and max in your data? Over what period was the data collected (1 day? 1 hour? 10 minutes?) – Gregor Thomas Oct 20 '18 at 14:52
  • 1
    do you at least know the frequency of the timestamps? – Alexis Drakopoulos Oct 20 '18 at 14:52
  • Give me a second, I will post the summary of the timestamp. We talk about minutes of collecting the data. – SteveS Oct 20 '18 at 14:53
  • This is taken from eventList from Android devices (Galaxy S8). I assume it's milliseconds since 1970 but in reality it's not. @Gregor – SteveS Oct 20 '18 at 14:59
  • @G5W I did play with the origin, meanwhile the best I have found is: `as.POSIXct(timestamp/10000000L, origin = "2017-08-07 15:30"))` – SteveS Oct 20 '18 at 15:13
  • Do you control the phone? If you reboot it does the origin change? – G. Grothendieck Oct 20 '18 at 15:27
  • @G.Grothendieck nope I do not. My goal is to convert a dataframe to time series and pass to Fast Fourier Transform. – SteveS Oct 20 '18 at 15:48

1 Answers1

1

So the below threads are inline with your issue. These numbers are not timestamps but rather nano seconds of system uptime. Your best bet is to modify the sensor code if you can.

As using as.POSIXct will not make sense as this is a time delta.

Accelerometer SensorEvent timestamp

SensorEvent.timestamp to absolute (utc) timestamp?

RK1
  • 2,384
  • 1
  • 19
  • 36