? LongDate("01/01/2003") ? LongDate(Datetime()) ? LongDate(Date()) FUNCTION LongDate(xDate) IF VARTYPE(xDate) = "C" IF LEN(xDate) = 10 AND ! EMPTY(CTOD(xDate)) xDate = CTOD(xDate) ELSE RETURN 0 ENDIF ENDIF IF VARTYPE(xDate) = "T" RETURN ; CDOW(xDate) + ", " + CMONTH(xDate) + " " + ALLTRIM(STR(DAY(xDate))) + ", " +; ALLTRIM(STR(YEAR(xDate))) + " at " + TTOC(xDate,2) ELSE IF VARTYPE(xDate) = "D" RETURN ; CDOW(xDate) + ", " + CMONTH(xDate) + " " + ALLTRIM(STR(DAY(xDate))) + ", " +; ALLTRIM(STR(YEAR(xDate))) ENDIF ENDIF ENDFUNC FUNCTION ShortDate(cLongDate as String,lAsDate as Boolean) && eg Sunday, March 30, 2003 LOCAL mMonth as String,mDay as String, mYear as String,mDate as String, mPos AS Integer cLongDate = SUBSTR(cLongDate,AT(",",cLongDate,1) + 2) && Strip off the day mMonth = SUBSTR(cLongDate,1,AT(" ",cLongDate,1)) cLongDate = SUBSTR(cLongDate,AT(" ",cLongDate,1) + 1) && Strip off the Month mDay = SUBSTR(cLongDate,1,AT(" ",cLongDate,1) - 2) cLongDate = SUBSTR(cLongDate,AT(" ",cLongDate,1) + 1) && Strip off the Day mYear = cLongDate mPos = ASCAN(oP.Arrays.Month.aArray,mMonth) IF mPos > 0 mPos = INT(mPos/4) + 1 mMonth = ALLTRIM(STR(oP.Arrays.Month.aArray[mPos,4])) ELSE RETURN CTOD("") ENDIF mDate = SET("Date") SET DATE DMY cLongDate = mDay +"/" + mMonth + "/" + mYear && reuse the variable IF lAsDate cLongDate = CTOD(cLongDate) ENDIF SET DATE &mDate RETURN cLongDate ENDFUNC