Welcome to the L3 Harris Geospatial documentation center. Here you will find reference guides and help documents.
﻿
>  Docs Center  >  IDL Reference  >  Advanced Math and Stats  >  IMSL_DAYSTODATE

IMSL_DAYSTODATE

IMSL_DAYSTODATE

The IMSL_DAYSTODATE procedure gives the date corresponding to the number of days since January 1, 1900.

The IMSL_DAYSTODATE procedure computes the date corresponding to the number of days since January 1, 1900. For a negative input value of days, the date computed is prior to January 1, 1900. This procedure is the inverse of the IDL Advanced Math and Stats IMSL_DATETODAYS function.

The Gregorian calendar’s first day after October 4, 1502, which became October 15, 1582. Prior to that, the Julian calendar was in use.

Examples

Example 1

The following example uses IMSL_DAYSTODATE to compute the date for the 100th day of 1986. This is accomplished by first using IMSL_DATETODAYS to get the “day number” for December 31, 1985.

`d0 = IMSL_DATETODAYS(31, 12, 1985)`
`IMSL_DAYSTODATE, d0 + 100, d, m, y`
`PM, d, m, y, TITLE = 'Day 100 of 1986 is (day-month-year)', \$`
`  FORMAT = '(20x, i3, i4, i7)'`
` `
`Day 100 of 1986 is (day-month-year)`
`10 4 1986`

Syntax

IMSL_DAYSTODATE, Days, Day[, Month[, Year]]

Return Value

Number of days from January 1, 1900, to the given date. If negative, it indicates the number of days prior to January 1, 1900.

Arguments

Days

Number of days since January 1, 1900.

Day

On return, this named variable is assigned the day of the date specified by days.

Month (optional)

If present, on return, this named variable is assigned the month of the date specified by days.

Year (optional)

If present, on return, this named variable is assigned the year of the date specified by days. The year 1950 corresponds to the year 1950 A.D., and the year 50 corresponds to year 50 A.D.

None

Version History

 6.4 Introduced