Timeseries and Milliseconds

Hi, i have this code and wanted to make timestamps in millisecond, but shows no millisecond values. This is for fast measurements with timesteps inferior to 1s.

I wanted to attach this file but firewall blocks, so i paste it, there is nothing sensible on it.

//Environment settings
clear();
path=["C:\Users\buehlpas\Desktop\Messungen\"];
name=["Test"];
ending=[".csv"];
header=["Time","one","two","three","four","five","six","seven","eight","nine","ten"];
// Creating file to put datas in
filename=fullfile(path+name+ending(1));
[unit,err]=file("open",filename,"new","sequential","formatted");
realtimeinit(0.5);
realtime(0);

for i=1:1:10
    realtime(i)
    write(unit,strcat([string(datetime("now","OutputFormat","yyyy-MM-dd HH:mm:ss.SSS")),string(1:10)],','));
end

file("close", unit);
//Reading the data-file
body=csvRead(filename,",",".","string");
ts=timeseries(datetime(body(:,1)),strtod(body(:,2:$)),"VariableNames",header);
stackedplot(ts);

Hello Pascal,

Indeed, it seems that datetime loses millisecond information during the conversion,
I opened an issue which will be corrected in the next version 2024.1.0 of May 2024

:+1:

Pascal Bühler hat über Gmail reagiert