Question on datetime Input Format
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Xymbu
am 30 Jan. 2021
Beantwortet: Cris LaPierre
am 30 Jan. 2021
I can't seem to get the input format for the date time conversion that works with data formatted as shown below
'Sat Jan 30 03:05:15 +0000 2021'
ive tried
'eeee MMMM d HH:mm:ss Z y'
but still nothing
0 Kommentare
Akzeptierte Antwort
Cris LaPierre
am 30 Jan. 2021
The trick for me was having to specify a time zone. I'm not sure what timezone it should be so I selected UTC. I found the format section of the datetime documentation page helpful in getting the input format correct.
d='Sat Jan 30 03:05:15 +0000 2021';
D = datetime(d,"InputFormat","eee MMM dd HH:mm:ss Z yyyy","TimeZone","UTC")
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Dates and Time finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!