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

| |

Was this topic helpful?