Products & Services Solutions Academia Support User Community Company

Learn more about Financial Toolbox   

month - Month of date

Syntax

[MonthNum, MonthString] = month(Date)
[MonthNum, MonthString] = month(Date, F)

Description

[MonthNum, MonthString] = month(Date) returns the month in numeric and string form given a serial date number or a date string.

[MonthNum, MonthString] = month(Date, F) returns the day of the of the month, given a serial date number or date string, in a specified date format.

Examples

[MonthNum, MonthString] = month(730368) 

or

[MonthNum, MonthString] = month('05-Sep-1999')

returns

MonthNum =

      9

MonthString =

Sep

You can also use the F argument to designate a country-specific date format:

[MonthNum, MonthString] = month('1999/05/09','yyyy/dd/mm')

returns

hmiMonthNum =

9

MonthString =

Sep

See Also

datevec, day, year

  


Free Interactive Computational Finance CD

View demos and recorded presentations led by industry experts.

Now On Demand
Network with industry peers and learn the latest applications of the leading software product for computational finance.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS