My head officially hurts.
I've got a date string: s = '2022-12-08T14:37:14.625Z' - Stupid programmers and Zulu time stamps....
It's actually an array of these but lets start simple.
I want to calculate the number of milliseconds in the string. Doesn't really matter from when. Epoch time, whatever. Just consistent so I can plot this foo-foo.
According to a plethora of posts around here and elsewhere on the web, I can do this with datetime with a format string: formatspec = 'yyyy-MM-dd''''T''''HH:mm:ss.SSS''''Z';
This gives me 'yyyy-MM-dd''T''HH:mm:ss.SSS''Z' for formatspec.
So I plug this into datetime, with s:
d = datetime(s,'ImportFormat', formatspec);
Matlab spits in my face and says "The format 'yyyy-MM-dd' 'T' 'HH:mm:ss.SSS' 'Z' contains an unsupported symbol: 'T'...."
Ok, but if I do it this way it accepts it: d = datetime(s,'ImportFormat', 'yyyy-MM-dd''T''HH:mm:ss.SSS''Z');
Any thoughts about why this works, but the formatspec string didn't would be greatly appreciated.
And any ideas about a really efficient way to get the number of milliseconds out of s = '2022-12-08T14:37:14.625Z' would probably get you an adult beverage of your choice!
bent