Trouble parsing ISO8601 date strings into datetime
Hi there I am trying to take some datasets with what I believe are ISO8601 timecodes and convert the timecodes to datetime for plotting and sorting by date and time. I think it is the data after the ‘+’ that is tripping me up, but I haven’t been able to find the right solution.
here is an example of one of the data entries, and the line that I am trying to excecute
Example data: "2023-06-09T23:55:00+00:00"
solardates= datetime(solar.Date,’InputFormat’,’uuuu-MM-dd”T”HH:mm:ss”+’,’TimeZone’,’UTC’);
And here are the errors I get when running the code.
Error using datetime (line 257)
Unable to convert the text to datetime using the format ‘uuuu-MM-dd’T’HH:mm:ss’+’.
Error in HistTest (line 30)
solardates= datetime(solar.Date,’InputFormat’,’uuuu-MM-dd”T”HH:mm:ss”+’,’TimeZone’,’UTC’);Hi there I am trying to take some datasets with what I believe are ISO8601 timecodes and convert the timecodes to datetime for plotting and sorting by date and time. I think it is the data after the ‘+’ that is tripping me up, but I haven’t been able to find the right solution.
here is an example of one of the data entries, and the line that I am trying to excecute
Example data: "2023-06-09T23:55:00+00:00"
solardates= datetime(solar.Date,’InputFormat’,’uuuu-MM-dd”T”HH:mm:ss”+’,’TimeZone’,’UTC’);
And here are the errors I get when running the code.
Error using datetime (line 257)
Unable to convert the text to datetime using the format ‘uuuu-MM-dd’T’HH:mm:ss’+’.
Error in HistTest (line 30)
solardates= datetime(solar.Date,’InputFormat’,’uuuu-MM-dd”T”HH:mm:ss”+’,’TimeZone’,’UTC’); Hi there I am trying to take some datasets with what I believe are ISO8601 timecodes and convert the timecodes to datetime for plotting and sorting by date and time. I think it is the data after the ‘+’ that is tripping me up, but I haven’t been able to find the right solution.
here is an example of one of the data entries, and the line that I am trying to excecute
Example data: "2023-06-09T23:55:00+00:00"
solardates= datetime(solar.Date,’InputFormat’,’uuuu-MM-dd”T”HH:mm:ss”+’,’TimeZone’,’UTC’);
And here are the errors I get when running the code.
Error using datetime (line 257)
Unable to convert the text to datetime using the format ‘uuuu-MM-dd’T’HH:mm:ss’+’.
Error in HistTest (line 30)
solardates= datetime(solar.Date,’InputFormat’,’uuuu-MM-dd”T”HH:mm:ss”+’,’TimeZone’,’UTC’); datetime, iso8601, iso 8601 MATLAB Answers — New Questions