Financial toolbox required for excel to matlab date conversion?

2 views (last 30 days)
This blows my mind. I have to import dates from an excel spreadsheet and the only way I can convert them to usable dates is by buying the financial toolbox AND the optimization toolbox? This is absurd! Please tell me there is another way to view dates in Matlab without having to spend another $3150. That is more than the cost of Matlab itself! All just to view dates in the IDE. I will be calling them first thing Monday morning to complain.

Accepted Answer

Star Strider
Star Strider on 28 Jun 2015
You can probably convert them using core MATLAB date functions. For a discussion of the differences between MATLAB and Excel date numbers, see the documentation for exceltime (although it does the inverse of what you want).
I generally import Excel dates and times as strings, and do the datenum conversions from them. It’s just easier that way.

More Answers (1)

Steven Lord
Steven Lord on 28 Jun 2015
Was there something in the documentation that led you to believe you needed those two toolboxes to convert the dates? If so, please use the "Did this help" buttons at the bottom of that documentation page to request that our documentation staff clarify that page. You can absolutely perform that conversion with MATLAB alone.
If you're using a release that has the DATETIME object, see this page from the documentation. If not, convert the reference dates listed on that page to serial date numbers with DATENUM and add that to the date numbers imported from Microsoft Excel.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!