transforming mm():mm() to 'yyyy/mm'

1 view (last 30 days)
Shiina Sponge
Shiina Sponge on 23 May 2020
Answered: Walter Roberson on 23 May 2020
date = mm(2020,1):mm(2020,3);
ans = 24240e+04 24241e+04 24242e+04
how to transform date to '2020/01','2020/02','2020/03'?
I used formatOut = 'yyyy/mm';d = datestr(date,formatOut); but it didn't work.

Answers (1)

Walter Roberson
Walter Roberson on 23 May 2020
datetime(date,'convertfrom', 'excel', 'format', 'yyyy-MM')

Community Treasure Hunt

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

Start Hunting!