Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

why datestr did not give reasonable output?

Asked by huda nawaf on 26 Nov 2012

hi, The range of my data is 2005 to Ontober 2007. when I extracted min and max, I got

709277 and 733325 why when use this function datestr(733325)

I will get : 10-Oct-2007

it is ok . and when use

 datestr(709277)

ans =

07-Dec-1941

Thanks in advance

11 Comments

huda nawaf on 2 Dec 2012

hi,

*The data that I used is flixster dataset

http://www.cs.sfu.ca/~sja25/personal/datasets/ this dataset is associated with timestamp lately.

I would like to say thing. when you install this dataset , you will find that timestamp in this format ex. 10/10/2007. i.e not integer. But, because this dataset is very huge, I converted the timestamp into integer, then get smaller file in terms of size.

when deal this dataset, I found out the min integer is 709277. befor writing this reply, I came back to original file ,I found out the coresponded date is 07-Dec-1941 as datestr did.

you can be sure if you checked the line with number 7756812. where each line in this dataset has 4 columns.the last column is the date. * thanks

Walter Roberson on 2 Dec 2012

I am not clear: are you saying that there is a date of 07-Dec-1941 in the original file? If so then there is no problem, datestr() is just responding correctly for the data.

If there was no 07-Dec-1941 in the original file, then we will need to know how you converted the dates.

huda nawaf on 2 Dec 2012

Yes the datestr is working correctly. I were thinking there is somthing error, because it is supposed that earliest time in this dataset in 2005. Now, I'm sure there is error in published data.

Thanks

huda nawaf

Tags

Products

No products are associated with this question.

1 Answer

Answer by Jan Simon on 26 Nov 2012

The answer 07-Dec-1941 is not only reasonable, but also correct. It is 24048 days before the 10-Oct-2007, as the serial date format implies.

0 Comments

Jan Simon

Contact us