.INDAYS - convert a date into a day number.

Alternate Entry Name: _INDAYS

Usage:

B:
   daynum = .indays(year,month,day);
C:
   #include <t_ctrl.h>
   int _indays(int year,int month,int day);

Where:

year
is an integer giving a year, as in 1993.
month
is an integer giving a month, with 1 standing for January, 2 for February, and so on.
day
is an integer giving the day of a month.
daynum
is the number of days of the given date since January 1, 1970. For example,
 .indays(1970,1,1)

is zero.

Description:

.INDAYS returns the number of days between the given date and January 1, 1970.

The "month" argument may fall outside the range from 1 to 12. If so, .INDAYS reduces the month modulo 12, and adjusts the year accordingly. For example,

 .indays(1990,13,1)

represents 13 months after the beginning of 1990; thus it stands for January 1, 1991.

Similarly, the days argument can fall outside the range of dates that actually exist within the month. If so, .INDAYS reduces the day figure to an appropriate range and adjusts the month and year accordingly.

See Also:

expl b lib .tosec
for a function that determines the number of seconds since 0:00 a.m. GMT, January 1, 1970.

Copyright © 1996, Thinkage Ltd.