convert a string into a date and time format

4 次查看(过去 30 天)
Hello, How can I convert this string into a date and time format in matlab. The months will be in spanish and the number of letters may vary for the month. This data will be obtained from different files and it will vary.
m ='October17,196616:41:00'
The result should be date_time= 1996/10/17 16:41:00
Thank you

采纳的回答

Star Strider
Star Strider 2023-1-4
Try something like this —
m ='October17,196616:41:00';
DT = datetime(m, 'InputFormat','MMMMdd,yyyyHH:mm:ss', 'Format','yyyy/MM/dd HH:mm:ss')
DT = datetime
1966/10/17 16:41:00
.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Dates and Time 的更多信息

产品


版本

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by