MATLAB: Compare date and time

datetimeMATLAB

I need to check of the date is after specific date and time. for example
if (datestr(datenum(datetime))) > (datestr([2017 05 21 12 00 00]
datetime is array of date in the format 22-May-2017 12:00:00

Best Answer

I would just use the result of datenum.
Comparing strings will probably not work as you would want it to.