NDYIN
Gives the date corresponding to the number of days since January 1, 1900.
Required Arguments
NDAYS — Number of days since January 1, 1900. (Input)
IDAY — Day of the input date. (Output)
MONTH — Month of the input date. (Output)
IYEAR — Year of the input date. (Output)
1950 would correspond to the year 195 A.D. and ‑50 would correspond to year 50 B.C.
FORTRAN 90 Interface
Generic: CALL NDYIN (NDAYS, IDAY, MONTH, IYEAR)
Specific: The specific interface name is NDYIN.
FORTRAN 77 Interface
Single: CALL NDYIN (NDAYS, IDAY, MONTH, IYEAR)
Description
Routine
NDYIN computes the date corresponding to the number of days since January 1, 1900. For an input value of
NDAYS that is negative, the date computed is prior to January 1, 1900. The routine
NDYIN is the inverse of
NDAYS.
Comments
The beginning of the Gregorian calendar was the first day after October 4, 1582, which became October 15, 1582. Prior to that, the Julian calendar was in use. Routine NDYIN makes the proper adjustment for the change in calendars.
Example
The following example uses
NDYIN to compute the date for the 100th day of 1986. This is accomplished by first using
NDAYS to get the “day number” for December 31, 1985.
USE NDYIN_INT
USE NDAYS_INT
USE UMACH_INT
IMPLICIT NONE
INTEGER IDAY, IYEAR, MONTH, NDAYO, NOUT, NDAY0
!
NDAY0 = NDAYS(31,12,1985)
CALL NDYIN (NDAY0+100, IDAY, MONTH, IYEAR)
CALL UMACH (2, NOUT)
WRITE (NOUT,*) 'Day 100 of 1986 is (day-month-year) ', IDAY, &
'-', MONTH, '-', IYEAR
END
Output
Day 100 of 1986 is (day-month-year) 10- 4- 1986
Published date: 03/19/2020
Last modified date: 03/19/2020