One rule many companies are adopting prior to Y2K is that all dates show all four digits of the year, often in a MM/DD/YYYY format. The problem is that the FormatDateTime function provided in VBScript isn't overly helpful in this regard. Instead of using the built-in function, you can build your own FormatDate function, shown here:
<%
Function LeftPad(intNumber, intDigits)
Dim strResult
Dim strTemp
Dim i
strTemp = CStr(intNumber)
strResult = String(intDigits - Len(strTemp), "0")
strResult = strResult & strTemp
LeftPad = strResult
End Function
Function FormatDate(datInput, strFormat)
Dim strResult ' As String
Dim intTemp ' As Integer
Dim strTemp ' As String
strResult = strFormat
strResult = Replace(strResult, "YYYY", Year(datInput), 1, -1, vbTextCompare)
strResult = Replace(strResult, "YY", Right(Year(datInput), 2), 1, -1, vbTextCompare)
strResult = Replace(strResult, "MM", LeftPad(Month(datInput), 2), 1, -1, vbTextCompare)
strResult = Replace(strResult, "M", Month(datInput), 1, -1, vbTextCompare)
strResult = Replace(strResult, "DD", LeftPad(Day(datInput), 2), 1, -1, vbTextCompare)
strResult = Replace(strResult, "D", Day(datInput), 1, -1, vbTextCompare)
FormatDate = strResult
End Function
%>
This will allow you to create dates that have left padded zeroes and those that don't. You can expand this function to handle month and day names; however, you'll need to be careful about evaluating the results. For instance, if you were to substitute the value 'March' for a code, the code might also substitute the month number for the first M in March.