Converting Unix Timestamp to Date Time
Hi,
I’m trying to convert Unix time stamps to date time. So far I have tried:
date_time=(timestamp_array./86400000) + datetime(1970,1,1);
This seems to work find, except that my first measurment was 2123 seconds off. I looked at a few other times and they were 2122 seconds off, 2125 seconds off, etc. I’m not sure what could be causing this discrepancy.
Here is my original time data:
And here is what I am getting after I use my code:
Any insights would be much appreciated!!
(I had to divide my timestamps by 86400000 instead of 86400 becuase all my timestamsps have 3 extra zeros for some reason. Also, all measurements are on the same day if that makes any difference)Hi,
I’m trying to convert Unix time stamps to date time. So far I have tried:
date_time=(timestamp_array./86400000) + datetime(1970,1,1);
This seems to work find, except that my first measurment was 2123 seconds off. I looked at a few other times and they were 2122 seconds off, 2125 seconds off, etc. I’m not sure what could be causing this discrepancy.
Here is my original time data:
And here is what I am getting after I use my code:
Any insights would be much appreciated!!
(I had to divide my timestamps by 86400000 instead of 86400 becuase all my timestamsps have 3 extra zeros for some reason. Also, all measurements are on the same day if that makes any difference) Hi,
I’m trying to convert Unix time stamps to date time. So far I have tried:
date_time=(timestamp_array./86400000) + datetime(1970,1,1);
This seems to work find, except that my first measurment was 2123 seconds off. I looked at a few other times and they were 2122 seconds off, 2125 seconds off, etc. I’m not sure what could be causing this discrepancy.
Here is my original time data:
And here is what I am getting after I use my code:
Any insights would be much appreciated!!
(I had to divide my timestamps by 86400000 instead of 86400 becuase all my timestamsps have 3 extra zeros for some reason. Also, all measurements are on the same day if that makes any difference) datetime, unix, datenum, time series MATLAB Answers — New Questions