How to convert a string into a date or datenum?
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a column, about [4000 x 1] with the format 'yyyymmddHH'. Yes, all the numbers are together.
And i need to get a date, or a datenum from that, but i cant, since functions like datetime need the numbers separated.
Anyone know how to get arround this?
Thank you.
0 commentaires
Réponses (1)
Stephen23
le 17 Juin 2021
Modifié(e) : Stephen23
le 17 Juin 2021
"... but i cant, since functions like datetime need the numbers separated."
I don't see that restriction mentioned anywhere in the DATETIME documentation.
S = ["2021061701";"2021010100";"1913061423"]
D = datetime(S, 'InputFormat','yyyyMMddHH')
6 commentaires
Stephen23
le 18 Juin 2021
@Bruno Carvalho: you can accept this answer, if one of the comments includes the solution.
Voir également
Catégories
En savoir plus sur Calendar 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!