Problem reading date format data from xpt file generated by SAS

Hi, I used the function 'xptread' to read data generated by SAS into MATLAB, which includes couple of variables that are in the date format. However, when I finished reading the data, the date variables are converted into numbers that are too small to be converted as dates in MATLAB. For example, the date Feb. 15, 2003 was replaced by a number 15751, which is way smaller than the right date number 731627 corresponding to this date in MATLAB. The difference between the two numbers is 715876, which is not the constant number (i.e. 693960) when converting dates between excel and MATLAB.
So my question is what should I do in this case? Should I add 715876 to each value of my date variables? Could anyone help me with this issue please? I have attached a xpt file including a sample of my data, which has 38 observations and 4 variables (3 are date variables).
Thank you very much!

Answers (0)

Products

Release

R2019b

Asked:

on 25 Oct 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!