00005 REM " Change from date type 7 to a number
00010 A$=CHR(97+1)+CHR(11+1)+CHR(1+1) !let A$ equal a pre-defined type 7 date
!which is stored as...
!CHR(YY+1) + CHR(MM+1) + CHR(DD+1)
00020 B$=STR(ASC(A$(1,1))); !let B$ equal the string of the year
C$=STR(ASC(A$(2,1))); !let C$ equal the string of the month
D$=STR(ASC(A$(3,1))) !let D$ equal the string of the day
00030 BB$=STR(NUM(B$)-1); !subtract 1 from the string of BB$
CC$=STR(NUM(C$)-1); !subtract 1 from the string of CC$
DD$=STR(NUM(D$)-1) !subtract 1 from the string of DD$
00035 IF LEN(BB$)=1 !test to see if the year is one digit
BBB$="0" !if it is, place a zero before it
ELSE
BBB$=""
00040 IF LEN(CC$)=1 !test to see if the month is one digit
CCC$="0" !if it is, place a zero before it
ELSE
CCC$=""
00045 IF LEN(DD$)=1 !test to see if the day is one digit
DDD$="0" !if it is, place a zero before it
ELSE
DDD$=""
00050 E$=BBB$+BB$+CCC$+CC$+DDD$+DD$ !let E$ equal the sum of the strings
00055 N=DTN(E$,"YYMMDD"); !let N equal the number from the string
N$=NTD(N,"YYMMDD") !let N$ equal the date from the number
00060 PRINT N,N$
00070 INPUT *