Help Center

AfxAstroDayfunction

Returns the Astronomical Day for any given date.

DateTimefunctionAfxTime.incdocumented

Syntax

FUNCTION AfxAstroDay (BYVAL nDay AS LONG, BYVAL nMonth AS LONG, BYVAL nYear AS LONG) AS LONG

Parameters

NameDescription
nDayA day number (1-31).
nMonthA month number (1-12).
nYearA four digit year.

Return value

The astronomical day.

Description

Returns the Astronomical Day for any given date.

Remarks

Among other things, can be used to find the number of days between any two dates, e.g.:

Example

PRINT AfxAstroDay(1, 3, -12400) - AfxAstroDay(28, 2, -12400) ' Prints 2 PRINT AfxAstroDay(1, 3, 12000) - AfxAstroDay(28, 2, -12000) ' Prints 8765822 PRINT AfxAstroDay(28, 2, 1902) - AfxAstroDay(1, 3, 1898) ' Prints 1459 days

Reference

  • Include file AfxTime.inc
  • Defined in AfxNova/AfxTime.inc:380
  • Documented in DateTime/DateTime Procedures.md
  • Topic: Date and Time Procedures