MATLAB: Change date format in vector date Hello i would like to uniform 2 different date format in a single vector: 4/1/2019 12:45:00 AM and 15/6/19 18:10 how can i do that? Best Answer t1 = datetime("4/1/2019 12:45:00 AM",'InputFormat',"dd/MM/yyyy HH:mm:ss a");t2 = datetime("15/6/19 18:10",'InputFormat',"dd/MM/yy HH:mm");t = [t1, t2] Related SolutionsMATLAB: How to convert string to date Date = '10:12:25 Tue 11-Dec-18'res = datetime(Date ,'InputFormat','HH:mm:ss eee dd-MMM-yy','Format','dd/MM/yyyy HH:mm a')Date = '10:12:25 Tue 11-Dec-18'res = datetime 11/12/2018 10:12 AM MATLAB: Datetime problem of converting string hh is uppercaseD=datetime('2019/09/05 19:02:11', 'InputFormat','yyyy/MM/dd HH:mm:ss') Related QuestionDatestr not working properlyConvert date to datetimeUnable to convert the text to datetime using the format: ‘dd-MM-yyyy hh:mm’How to convert datetime in string format to Matlab datetimeAdd zero time in timeseries date time columnDatetime default stetings 12/24
Best Answer