datetime InputFormat error in R2021a but works in R2017b ?

조회 수: 1(최근 30일)
Dave 2021년 8월 28일
댓글: Star Strider 2021년 8월 28일
Hello, using datetime in R2021a brings an error while the same task works in R2017b, Is there a way to fix the issue in the newer version?
In R2017b
c =
In R2021a
c= datetime(b,'InputFormat','yyyyQQ')
Error using datetime (line 647)
Unable to convert '2004Q1' to datetime using the format 'yyyyQQ'.

채택된 답변

Star Strider
Star Strider 2021년 8월 28일
That seems to have changed between releases. In R2021a, it’s necessary to use 'QQQ' to designate ‘long format’ quarters —
c= datetime(b,'InputFormat','yyyyQQQ')
c = datetime
See Format for details.
  댓글 수: 1
Star Strider
Star Strider 2021년 8월 28일
As always, my pleasure!
Yes. I linked to them in my Answer. (At least I believe that’s the information you want. If it isn’t, post back with a description, and I’ll look again.)

댓글을 달려면 로그인하십시오.

추가 답변(0개)

Community Treasure Hunt

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

Start Hunting!

Translated by