home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 19
/
CD_ASCQ_19_010295.iso
/
dos
/
prg
/
bas
/
hanlin3
/
pbc30a
/
dater2a.bas
< prev
next >
Wrap
BASIC Source File
|
1994-03-13
|
1KB
|
41 lines
' +----------------------------------------------------------------------+
' | |
' | PBClone Copyright (c) 1990-1994 Thomas G. Hanlin III |
' | |
' +----------------------------------------------------------------------+
DECLARE FUNCTION AscM% (St$, BYVAL Posn%)
SUB DateR2A (MonthNr%, DayNr%, YearNr%, RelDate&)
TDate& = RelDate&
YearNr% = 1899
DO WHILE TDate& >= 365&
IF YearNr% MOD 4 = 0 AND YearNr% MOD 100 > 0 OR YearNr% MOD 400 = 0 THEN
TDate& = TDate& - 366&
ELSE
TDate& = TDate& - 365&
END IF
YearNr% = YearNr% + 1
LOOP
IF TDate& < 0& THEN
MonthNr% = 12
DayNr% = 31
YearNr% = YearNr% - 1
ELSE
TDate& = TDate& + 1&
MonthNr% = 1
IF YearNr% MOD 4 = 0 AND YearNr% MOD 100 > 0 OR YearNr% MOD 400 = 0 THEN
MonthDay$ = "313232332323"
ELSE
MonthDay$ = "303232332323"
END IF
tmp% = AscM%(MonthDay$, MonthNr%) - 20
DO WHILE TDate& > CLNG(tmp%)
TDate& = TDate& - CLNG(tmp%)
MonthNr% = MonthNr% + 1
tmp% = AscM%(MonthDay$, MonthNr%) - 20
LOOP
DayNr% = CINT(TDate&)
END IF
END SUB