Converting date string to number

27 visualizzazioni (ultimi 30 giorni)
Danielle Leblance
Danielle Leblance il 11 Feb 2018
Risposto: Walter Roberson il 11 Feb 2018
I have a vector of the following format 01-Jul-1980 00:00:00 how can I convert to a matlab date number?
  1 Commento
Danielle Leblance
Danielle Leblance il 11 Feb 2018
Please find attached the vector that I am trying to convert

Accedi per commentare.

Risposte (3)

Danielle Leblance
Danielle Leblance il 11 Feb 2018
I put it in excel and convert it to excel number then to matlab number using x2mdate function. So I have managed to find a way to go over it.

Jan
Jan il 11 Feb 2018
S = '01-Jul-1980 00:00:00';
datenum(S) % Old
datetime(S) % Modern

Walter Roberson
Walter Roberson il 11 Feb 2018
You have a datetime array. You can convert it to serial datenum using
datenum(issuedate)
Note that this is typically not required any more, but can be required for some plotting reasons from R2013b to R2015b.

Categorie

Scopri di più su Dates and Time in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by