=========================================================================== BBS: The Abacus * HST/DS * Potterville MI Date: 03-27-93 (10:38) Number: 150 From: JOE NEGRON Refer#: 124 To: JIM COYLE Recvd: NO Subj: Blah. Conf: (35) Quick Basi --------------------------------------------------------------------------- JC> Does anyone have a Date2Int function that could be posted? Thanks. Ask and ye shall receive... ============================== Begin code ============================== DEFINT A-Z DECLARE FUNCTION Date2Day% (DateX$) DECLARE FUNCTION Date2Mth% (DateX$) DECLARE FUNCTION Date2Serial& (DateX$) DECLARE FUNCTION Date2Year% (DateX$) '*********************************************************************** '* FUNCTION Date2Day% '* '* PURPOSE '* Returns the day number given a date in the standard date format. '*********************************************************************** FUNCTION Date2Day% (DateX$) STATIC Date2Day% = VAL(MID$(DateX$, 4)) END FUNCTION '*********************************************************************** '* FUNCTION Date2Mth% '* '* PURPOSE '* Returns the month number given a date in the standard date format. '*********************************************************************** FUNCTION Date2Mth% (DateX$) STATIC Date2Mth% = VAL(DateX$) END FUNCTION '*********************************************************************** '* FUNCTION Date2Serial& '* '* PURPOSE '* Returns the astronomical Julian day number given a date in the '* standard date format. Note that the year must be 1583 or greater. '* '* INTERNAL ROUTINE(S) '* FUNCTION Date2Day% (DateX$) '* FUNCTION Date2Mth% (DateX$) '* FUNCTION Date2Year% (DateX$) '*********************************************************************** FUNCTION Date2Serial& (DateX$) STATIC Month% = Date2Mth%(DateX$) Day% = Date2Day%(DateX$) Year% = Date2Year%(DateX$) IF Month% > 2 THEN Month% = Month% - 3 ELSE Month% = Month% + 9 Year% = Year% - 1 END IF TA& = 146097 * (Year% \ 100) \ 4 TB& = 1461& * (Year% MOD 100) \ 4 TC& = (153 * Month% + 2) \ 5 + Day% + 1721119 Date2Serial& = TA& + TB& + TC& END FUNCTION '*********************************************************************** '* FUNCTION Date2Year% '* '* PURPOSE '* Returns the year number given a date in the standard date format. '*********************************************************************** FUNCTION Date2Year% (DateX$) STATIC Date2Year% = VAL(MID$(DateX$, 7)) END FUNCTION =============================== End code =============================== --Joe in Bay Ridge, Brooklyn, NY, Sat, 03-27-1993-- ... Diplomacy: Saying "nice doggie"...until you find a rock. ___ X Blue Wave/QWK v2.12 X --- Maximus 2.01wb * Origin: * BlueDog BBS * (212) 594-4425 * NYC FileBone Hub (1:278/709) SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1 SEEN-BY: 153/752 154/40 77 157/2 159/100 125 430 950 203/23 209/209 280/1 SEEN-BY: 390/1 396/1 15 397/2 2230/100 3603/20