Converting date string to number

14 ビュー (過去 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 Center および File ExchangeDates and Time についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by