MATLAB: Frustrating datetime and datestr

datestrdatetimeMATLABtime

Hey I got this
hund = datetime(end_stamp, 'convertfrom','posixtime')
% which give this:
hund =
datetime
05-Nov-2018 00:00:00
Because this one hit time 00:00:00 and I use datestr i get this:
hund = datestr(hund)
hund = '05-Nov-2018'
But I need to get the exact line as a string:
hund = '05-Nov-2018 00:00:00'
Anyone have an idea ?

Best Answer

Not sure why you'd want to convert from datetime to datestr, but here's your solution:
datestr(t,'dd-mmm-yyyy HH:MM:SS')