| Financial Toolbox | Search  Help Desk |
| eomdate | Examples See Also |
Syntax
d = eomdate(y, m)
Description
d = eomdate(y, m)
returns the serial date number d of the last date of the month for the given year y and month m. Enter y as a four-digit integer; enter m as an integer from 1 to 12.
Either input argument can contain multiple values, but if so, the other input must contain the same number of values or a single value that applies to all. For example, if y is a 1-by-N vector of integers, then m must be a 1-by-N vector of integers or a single integer. d is then a 1-by-N vector of date numbers.
Use the function datestr to convert serial date numbers to formatted date strings.
Examples
d = eomdate(1997, 2)
d =
729449
datestr(d)
ans =
28-Feb-1997
y = [1997 1998 1999 2000];
d = eomdate(y, 2)
d =
729449 729814 730179 730545
datestr(d)
ans =
28-Feb-1997
28-Feb-1998
28-Feb-1999
29-Feb-2000
See Also
day, eomday, lbusdate, month, year