필터 지우기
필터 지우기

how to convert string to date?

조회 수: 4 (최근 30일)
Pasquale
Pasquale 2019년 3월 22일
편집: Stephan 2019년 3월 22일
I would convert this string '10:12:25 Tue 11-Dec-18' into a date with this format: 11/12/2018 10:12 AM.
I tried to use the function datetime, but it does not recognize the string as a date, because of the day name Tue.

채택된 답변

Stephan
Stephan 2019년 3월 22일
편집: Stephan 2019년 3월 22일
Date = '10:12:25 Tue 11-Dec-18'
res = datetime(Date ,'InputFormat','HH:mm:ss eee dd-MMM-yy','Format','dd/MM/yyyy HH:mm a')
Date =
'10:12:25 Tue 11-Dec-18'
res =
datetime
11/12/2018 10:12 AM

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by