Converting date string to number

조회 수: 27 (최근 30일)
Danielle Leblance
Danielle Leblance 2018년 2월 11일
답변: Walter Roberson 2018년 2월 11일
I have a vector of the following format 01-Jul-1980 00:00:00 how can I convert to a matlab date number?
  댓글 수: 1
Danielle Leblance
Danielle Leblance 2018년 2월 11일
Please find attached the vector that I am trying to convert

댓글을 달려면 로그인하십시오.

답변 (3개)

Danielle Leblance
Danielle Leblance 2018년 2월 11일
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 2018년 2월 11일
S = '01-Jul-1980 00:00:00';
datenum(S) % Old
datetime(S) % Modern

Walter Roberson
Walter Roberson 2018년 2월 11일
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.

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by