Change data type of a table column into datetime?

47 vues (au cours des 30 derniers jours)
Julozert
Julozert le 27 Mai 2020
Hi,
I have read a table with readtable and changed my the column with the time data to a char using detectImportOptions-function.
I now wanna change the data type from char to datetime but it doesnt work. How do i need to do it?

Réponses (2)

Eric Sofen
Eric Sofen le 9 Juin 2020
Take a look at the convertvars function for changing the data type of a table variable.
Also, is there a reason you're bring in the time data as char rather than directly as datetime or duration from readtable?

Drishti Jain
Drishti Jain le 28 Mai 2020
e.g-
tm='10:14:25'
new_tm= datetime(tm,'Format','HH:mm:ss')

Catégories

En savoir plus sur Tables 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!

Translated by