Financial Toolbox    

Date Formats

You most often work with date strings (14-Sep-1999) when dealing with dates. The Financial Toolbox works internally with serial date numbers (e.g., 730377). A serial date number represents a calendar date as the number of days that has passed since a fixed base date. In MATLAB, serial date number 1 is January 1, 0000 A.D. MATLAB also uses serial time to represent fractions of days beginning at midnight; for example, 6 p.m. equals 0.75 serial days. So 6:00 pm on 14-Sep-1999, in MATLAB, is date number 730377.75.

Many toolbox functions that require dates accept either date strings or serial date numbers. If you are dealing with a few dates at the MATLAB command-line level, date strings are more convenient. If you are using toolbox functions on large numbers of dates, as in analyzing large portfolios or cash flows, performance improves if you use date numbers.

The toolbox provides functions that convert date strings to serial date numbers, and vice versa.


  Handling and Converting Dates Date Conversions