ymd2dn: Convert from year, month, day to day number of year

Description Usage Arguments Details Value Author(s) Examples

Description

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

Usage

1
ymd2dn(yr, m, d)

Arguments

yr

4-digit year (like 1988), integer, scalar or vector

m

month number, integer (1-12), scalar or vector

d

day of month, integer (1-31), scalar or vector

Details

On error, the function returns

1
m = d = -1

.

Conversion in the opposite direction is given by function ydn2md.

Copyright (C) 1985, Johns Hopkins University/Applied Physics Laboratory This software may be used, copied, or redistributed as long as it is not sold and this copyright notice is reproduced on each copy made. This routine is provided as is without any express or implied warranties whatsoever. Other limitations apply as described in the file disclaimer.txt.

Value

dy

day number in year, integer (1-365), scalar or vector

Author(s)

Written by R. Sterner, JHU/APL 1985

Adapted to IDL by W. Landsman 1998

R adaptation by Arnab Chakraborty (June 2013)

Examples

1
2
3
4
#  Find the days of the year for June 4 and September 12 in the year 2001
#  Result: days 155 and 255 

ymd2dn(2001, c(6,9), c(4,12))

astrolibR documentation built on May 2, 2019, 3:26 a.m.