day_of_year, days_in_month, monthday, isleapyear

Date functions


Synopsis

    function day_of_year(
        year  : integer,
        month : integer,
        day   : integer
    )

    function days_in_month(
        year  : integer,
        month : integer
    )

    function monthday(
        year : integer,
        day  : integer
    )

    function isleapyear(
        year : integer
    )


Arguments

year
Array of any dimensionality, each value must be >= 0.
month
Array of any dimensionality, each value must be an integer from 1 to 12.
day
Array of any dimensionality. For the day_of_year function, day represents the day of the month (1 to 31). For the monthday function, day represents the day of the year (1 to 366).

Description

day_of_year returns an integer array (of the same dimensionality as year, day, and month), where each value represents the day of the year (Gregorian calendar). For example, given month 3, day 1, and year 1996, day_of_year would return a value of 61.

days_in_month returns an integer array (of the same dimensionality as year and month), where each value represents the number of days in a particular month (Gregorian calendar).

monthday returns an integer array (same dimensionality as year), where each value represents the concatenated month and day as an integer, (Gregorian calendar). For example, given year 1933 and day 245, monthday would return 902 for September 2.

isleapyear returns a logical array (with same dimensionality as year), where each value is true or false, depending if the corresponding year is a leap year (Gregorian calendar).


Example

;
; Every element of 'i' will be false in this case.
;
i = isleapyear((/1997,1993,1900,1990/))

;
; 'j' will be equal to (/61,60/).
;
j = day_of_year((/1996,1990/),(/3,3/),(/1,1/))

;
; 'k' will be equal to (/29,28,31/)
;
k = days_in_month((/1996,1997,1/),(/2,2,1/))

;
; 'l' will be equal to (/902,1231,1231,301/)
;
l = monthday((/1933,1996,1997,1996/),(/245,366,365,61/))


Reference Manual Control Panel

NG4.1 Home, Index, Examples, Glossary, Feedback, Ref Contents, Ref WhereAmI?


$Revision: 1.6 $ $Date: 1998/06/15 21:29:04 $