datestr function Unrecognized month format error
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Yusuf Suer Erdem
le 12 Juil 2021
Commenté : Yusuf Suer Erdem
le 15 Juil 2021
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 commentaires
Réponse acceptée
Walter Roberson
le 12 Juil 2021
you have 5 m for the month field but datestr only permits up to 4 m
0 commentaires
Plus de réponses (1)
Seth Furman
le 14 Juil 2021
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)
Voir également
Catégories
En savoir plus sur Dates and Time dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!