Change date format in vector

조회 수: 2 (최근 30일)
Davide Cerra
Davide Cerra 2020년 8월 20일
답변: Binbin Qi 2020년 8월 20일
Hello i would like to uniform 2 different date format in a single vector:
4/1/2019 12:45:00 AM and 15/6/19 18:10
how can i do that?
  댓글 수: 2
Davide Cerra
Davide Cerra 2020년 8월 20일
The vector itself contains the 2 formats
Walter Roberson
Walter Roberson 2020년 8월 20일
What is the data type being used? A vector of datetime only has one format associated with it.

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

채택된 답변

Binbin Qi
Binbin Qi 2020년 8월 20일
t1 = datetime("4/1/2019 12:45:00 AM",'InputFormat',"dd/MM/yyyy HH:mm:ss a");
t2 = datetime("15/6/19 18:10",'InputFormat',"dd/MM/yy HH:mm");
t = [t1, t2]

추가 답변 (0개)

카테고리

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