convert dd/mm/yyyy ro serial

1 Ansicht (letzte 30 Tage)
Sophia Chen
Sophia Chen am 18 Jan. 2021
Beantwortet: Walter Roberson am 18 Jan. 2021
I got some data in excel with date in the formate of dd/mm/yyyy
d = xlsread ('excel.xlsx','D9:D7808')
then I try to do a datenum, but it doesn't work becuase the data is in dd/mm/yyyy
so How could I convert dd/mm/yyyy to yyyy-mm-dd or convert date into serial in some other ways
Thanks
  2 Kommentare
Rik
Rik am 18 Jan. 2021
Is the data stored as a date in the excel file? Or as text?
Image Analyst
Image Analyst am 18 Jan. 2021
Here's another chance to read the posting guidelines you skipped over when posting:
After you remember to upload your workbook, we'll be able to help more.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Walter Roberson
Walter Roberson am 18 Jan. 2021
d = readmatrix('excel.xlsx', 'D9:D7808');
d.Format = 'yyyy-MM-dd';
And if you need to,
cellstr(d)

Kategorien

Mehr zu Dates and Time finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by