NCL Home > Documentation > Functions > Date routines

days_in_month

Calculates the number of days in a month given month, day, and year.

Prototype

	function days_in_month (
		year   : integer,  
		month  : integer   
	)

	return_val [dimsizes(year)] :  integer

Arguments

year

A multi-dimensional integer array or scalar value representing years. Values must be >= 0.

month

An integer array of the same size as year representing months of the year. Values must be 1 to 12.

Return value

A integer array of the same size as year where each value represents the number of days in a particular month (Gregorian calendar)

Description

Calculates the number of days in a month given arrays of months, days, and years.

See Also

day_of_year, day_of_week, monthday, isleapyear

Examples

Example 1

dim = days_in_month((/1996,1997,1/),(/2,2,1/))
; dim = (/29,28,31/)