MATLAB: Converting dateTime RFC3339 to matlab datetime format

datetimerfc3339

Hi,
I want to convert tiem format RFC3339 to matlab datetime format.
the RFC3339 format looks like this:
'2020-10-07T14:50:01.742Z'
I want to convert in such a way that i can be able to see the millisconds as well.
Thanks.

Best Answer

Try this
str = '2020-10-07T14:50:01.742Z';
dt = datetime(str, 'InputFormat', 'yyyy-MM-dd''T''HH:mm:ss.SSS''Z''');
Result
>> dt
dt =
datetime
07-Oct-2020 14:50:01