The FormatDateNoSep function returns mmddyyyy, or mmddyy.
Syntax:
noseparators = FormatDateNoSep(datevar,2 or 4)Example Usage:
ASP Source Code:<% = FormatDateNoSep(date(),2) %>Returns: 122124
and
<% = FormatDateNoSep(date(),4) %>Returns: 12212024
<% Function FormatDateNoSep(DateValue, yrDig) Dim strYYYY Dim strMM Dim strDD strYYYY = CStr(DatePart("yyyy", DateValue)) if yrDig = 2 then strYYYY = Right(strYYYY, 2) strMM = CStr(DatePart("m", DateValue)) If Len(strMM) = 1 Then strMM = "0" & strMM strDD = CStr(DatePart("d", DateValue)) If Len(strDD) = 1 Then strDD = "0" & strDD FormatDateNoSep = strMM & strDD & strYYYY End Function %>