converting string (python) datetime to matlab

조회 수: 7 (최근 30일)
Sonia Sonia
Sonia Sonia 2020년 8월 19일
편집: jonas 2020년 8월 19일
I have a datatime string which looks like so:
datatime_str='2020-08-18 16:48:13.722422+00:00'
I then do in matlab 2018a:
fmt_dt='yyyy-MM-dd HH:mm:ss.SSSSSS+HH:mm';
datetime(datatime_str,'TimeZone','local','Format',fmt_dt);
and I get:
2020-08-18 00:00:13.722422+00:00
I am not sure what it is that I am doing wrong, but the result is obviously wrong :(
Any help would be great
Sonia
  댓글 수: 1
Serhii Tetora
Serhii Tetora 2020년 8월 19일
datetime(datatime_str,'TimeZone','local','InputFormat',fmt_dt)

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

답변 (1개)

jonas
jonas 2020년 8월 19일
편집: jonas 2020년 8월 19일
fmt_dt='yyyy-MM-dd HH:mm:ss.SSSSSSZ';
Also, as noted in the comments, Format should be replaced by InputFormat

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by