I use matlab R2015a, when I run my script I want print the date and the time of exection
I tried this code
Dtimes=datetime('now','TimeZone','local','Format','d-MMM-y HH:mm:ss Z'); % the first test disp(' Date and time is ' Dtimes ); % But not work % second test disp(sprintf('date and time is %s ',Dtimes)) %also not work
But with this command is worked :
disp(sprintf('date and time is %s ',datestr(now)));
What is the problem?