MATLAB: Not expected results using datevec funcion

datevecMATLAB

Dear colleagues,
I am writing from Brazil in order to get some help about datavec funciton.
I am using this fucntion to convert a date string data to vector format ([yy mm dd HH MM SS])
In Brazil date format is defined as follows: dd/mm/yy. I have a set of date data in two main formats. one without timestamp and another with timestamp, for instance: '13/12/2013' , '13/12/2013 00:15:00', respectively.
I get an error when I call the function to get the conversion:
Situation 1) result = datevec('13/12/2013', 'dd/mm/yyyy HH:MM:SS');
When I use the function with data with timestamp, as follows
Situation 2) result = datevec('13/12/2013 00:00:00', 'dd/mm/yyyy HH:MM:SS');
or
Situation 3) result = datevec('13/12/2013 00:15:00', 'dd/mm/yyyy HH:MM:SS');
I get correct answer:
Anybody has some hint to handle situation 1?
I appreciate any help. Thanks all in advance.
Best regards, Luis.

Best Answer

Use this
result = datevec(datestr('13/12/2013', 'dd/mm/yyyy HH:MM:SS'))
datestr will set the missed time to 00:00:00