Unable to read datetime with format "0600 UTC OCT 25"
Ältere Kommentare anzeigen
When I import data from a kml file using readtable, it stores the date and time in a string array called Name formatted like this:
"1200 UTC OCT 10"
"1800 UTC OCT 10"
"0000 UTC OCT 11"
"0600 UTC OCT 11"
In the latest round of my bout with datetime, I'm struggling to get this into a datetime variable.
I have tried this, but it doesn't work:
datimStorm = datetime( Name, 'InputFormat', 'hhmm ''UTC'' MM yy' );
Can this be done using the 'InputFormat', or do I have to do it myself with substrings?
1 Kommentar
dormant
am 25 Okt. 2023
Akzeptierte Antwort
Weitere Antworten (1)
t = "1200 UTC OCT 10"
td = datetime(t,'InputFormat','hhmm ''UTC'' MMM dd')
2 Kommentare
Ooops should have been
t = "1200 UTC OCT 10"
td = datetime(t,'InputFormat','HHmm ''UTC'' MMM dd')
dormant
am 25 Okt. 2023
Kategorien
Mehr zu Dates and Time finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!