Learn R Programming

astrolibR (version 0.1)

ydn2md: Convert from year and day number of year to month and day of month

Description

Convert from year and day number of year to month and day of month

Usage

ydn2md(yr, dy)

Arguments

yr
4-digit year (like 1988), integer, scalar
dy
day number in year (like 310), integer, scalar or vector

Value

m
month number, integer (1-12)
d
day of month, integer (1-31)

Details

Conversion in the opposite direction is given by function ymd2dn.

On error, the function returns

m = d = -1
.

See Also

ymd2dn

Examples

Run this code
#  Find the month/day of days 155 and 255 in the year 2001
#  Result: m=c(6,9)  d=c(4,12), or June 4 and September 12 

ydn2md(2001, c(155,255))

Run the code above in your browser using DataLab