MATLAB Answers

Readtable 00:00:00 is missing

3 views (last 30 days)
chris_andreas
chris_andreas on 25 Jul 2016
Answered: Titus Edelhofer on 25 Jul 2016
Hi. I have an Excelfile with a.o. a DateTime column. When I import the data in MATLAB with readtable the DateTimes like "15.06.2016 00:00:00" are always imported as just "15.06.2016". This problem just occures with 00:00:00 at the end.
Can anyone help, that the DateTime is imported correctly (with the 00:00:00)? Thanks a lot!

  0 Comments

Sign in to comment.

Answers (1)

Titus Edelhofer
Titus Edelhofer on 25 Jul 2016
Hi,
I'm not sure if there is really a problem. I think it's just a question of display. Take a look at this code fragment:
s1 = datetime(2016, 6, 5)
s1 =
05-Jun-2016
s2 = datetime(2016, 6, 5, 0, 0, 0)
s2 =
05-Jun-2016 00:00:00
They are displayed differently but are indeed equal:
isequal(s1, s2)
ans =
1
You might change the display format later on:
s1.Format = 'dd-MMM-uuuu HH:mm:ss'
s1 =
05-Jun-2016 00:00:00
Hope this helps,
Titus

  0 Comments

Sign in to comment.

Sign in to answer this question.