How can I turn a date in the format: '2018-03-2​5T05:15:00​.000Z' in a datetime vector?

조회 수: 2 (최근 30일)
I'm currently working with an API that gives me a timestamp like this and I can't seem to convert it in a datetime value.
Any thoughts?
Thanks in advance!

채택된 답변

Peter Perkins
Peter Perkins 2018년 4월 6일
The short answer is
>> datetime('2018-03-25T05:15:00.000Z','InputFormat','uuuu-MM-dd''T''HH:mm:ss.SSS''Z''')
ans =
datetime
25-Mar-2018 05:15:00
The longer answer is that you've got something funny going on in the text that you posted:
>> double('2018-03-25T05:15:00.000Z')
ans =
Columns 1 through 9
50 48 49 56 45 48 51 45 50
Columns 10 through 18
8203 53 84 48 53 58 49 53 58
Columns 19 through 26
48 48 8203 46 48 48 48 90
  댓글 수: 2
Thomas Nguyen
Thomas Nguyen 2018년 4월 6일
You guys are so quick on answering people's questions :p I'm just looking around for fun assignments to tackle but everything has been solved :<<
Fabio Barbosa
Fabio Barbosa 2018년 4월 6일
Maybe this one? :P https://www.mathworks.com/matlabcentral/answers/393103-how-can-i-post-an-order-request-via-api

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

추가 답변 (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