datestr function Unrecognized month format error
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello :) could you help me with that error below?
"Error using matlab.internal.datetime.cnv2icudf (line 99) Unrecognized month format. Format: mmmmm dd, yyyy HH:MM:SS.FFF AM."
Those are my codes;
clc; clear; close all;
monday=datestr(now,'mmmmm dd, yyyy HH:MM:SS.FFF AM')
댓글 수: 0
채택된 답변
Walter Roberson
2021년 7월 12일
you have 5 m for the month field but datestr only permits up to 4 m
댓글 수: 0
추가 답변 (1개)
Seth Furman
2021년 7월 14일
We highly recommend using datetime in place of datestr, now, datenum, etc.
You can get a datetime version of the same value using datetime('now') and convert it to a text representation using the string function.
e.g.
dt = datetime('now','Format','MMMM dd, yyyy hh:mm:ss.SSS a')
txt = string(dt)
참고 항목
카테고리
Help Center 및 File Exchange에서 Dates and Time에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!