Hello,
I'm trying to import a date string such as '01/10/2018 16:09:26,934';
However when doing the following:
DateString = '01/10/2018 16:09:26,934';
formatIn = 'MM/dd/yyyy HH:mm:SS,sss';
datetime(DateString,'InputFormat',formatIn)
It returns the following error:
Unable to parse '01/10/2018 16:09:26,934' as a date/time using the format 'MM/dd/yyyy HH:mm:SS,sss'.
Any ideas?

댓글 수: 2

Jan
Jan 2018년 1월 10일
Whenever you mention, that you get an error, post a copy of the complete message. It is easier to fix a problem than to guess the error.
Rodrigo Alvarez Hernandez
Rodrigo Alvarez Hernandez 2018년 1월 10일
Sorry, edited question

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

 채택된 답변

Jan
Jan 2018년 1월 10일
편집: Jan 2018년 1월 10일

0 개 추천

The seconds are lower case 'ss', the fractional seconds uppercase 'SSS':
formatIn = 'MM/dd/yyyy HH:mm:ss,SSS'

댓글 수: 2

Rodrigo Alvarez Hernandez
Rodrigo Alvarez Hernandez 2018년 1월 10일
uhgh, I feel so stupid, ive been looking that page wondering what was wrong...
Kudos!
Jan
Jan 2018년 1월 10일
You are welcome, Rodrigo. It is a well known fact, that the eyes of a programmer are blind for the problems, which are solved inside the brain already. Then it is useful to ask another person, who find the problem on the first view. I know this from my own experiences also :-)

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Time Series Objects에 대해 자세히 알아보기

질문:

2018년 1월 10일

댓글:

Jan
2018년 1월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by