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_DATETODAYS

### IMSL_DATETODAYS

IMSL_DATETODAYS

The IMSL_DATETODAYS function computes the number of days from January 1, 1900, to the given date.

This routine requires an IDL Advanced Math and Stats license. For more information, contact your sales or technical support representative.

The IMSL_DATETODAYS function returns the number of days from January 1, 1900, to the given date and returns negative values for days prior to January 1, 1900. A negative year can be used to specify B.C. Input dates in year 0 and for October 5, 1582, through October 14, 1582, inclusive, do not exist; consequently, in these cases, IMSL_DATETODAYS issues an error.

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

## Examples

### Example 1

The following example uses IMSL_DATETODAYS to compute the number of days from January 15, 1986, to February 28, 1986.

`d0 = IMSL_DATETODAYS(15, 1, 1986)`
`d1 = IMSL_DATETODAYS(28, 2, 1986)`
`PM, d1 - d0, TITLE = 'Number of days from 1/15/86 to 2/28/86'`
` `
`Number of days from 1/15/86 to 2/28/86`
`44`

## Syntax

Result = IMSL_DATETODAYS([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

### Day

Day of the input date.

### Month

Month of the input date.

### Year

Year of the input date. 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