MATLAB: Datetime from Unix time miliseconds

datetime date time millisecondsMATLAB

Hello,
I am using a data source that gives a unix time(down to miliseconds), I want to convert this to a date string, I am currently using
dt = datestr(datetime(values(1)/1000, 'ConvertFrom', 'posixtime') + hours(2)); %add 2 hours for gmt +2
The division by 1000 is because the datestring can't handle mili second unix time.
With google I can't find a way to tell matlab to include milliseconds to datetime, but I really need the milliseconds. Did I overlook something?
Thanks in advance,
Bearpie
P.S. Matlab 2016A

Best Answer

I ended up removing the last 3 chars from the unix time in ms to get it in seconds. Than I parsed the last 3 to an int and added that to datetime by using
datetime + milliseconds(lastThreeChars);
This added the milliseconds to my datetime!