MATLAB Answers

Transform into a Matlab datetime format

1 view (last 30 days)
alpedhuez
alpedhuez on 14 Jun 2018
Commented: alpedhuez on 14 Jun 2018
I have an entry "2017-10-26 06-PM" How can I transform this entry into a datetime format that Matlab can understand?

  0 Comments

Sign in to comment.

Accepted Answer

Sean de Wolski
Sean de Wolski on 14 Jun 2018
Edited: Sean de Wolski on 14 Jun 2018
datetime("2017-10-26 06-PM",'InputFormat','yyyy-MM-dd hh-aa')

  3 Comments

alpedhuez
alpedhuez on 14 Jun 2018
Thank you. I have a table A with the entries of the first column are of the format "2017-10-26 06-PM." How can I transform this first column into datetime format?
Guillaume
Guillaume on 14 Jun 2018
exactly the same way:
yourtable.columnname = datetime(yourtable.columname, 'InputFormat', 'yyyy-MM-dd hh-aa')

Sign in to comment.

More Answers (0)

Sign in to answer this question.

Tags

Products