Code:
strDate = "08/15/2003"
newDate = CDate(strDate)
getMonth = Month(newDate)
getDay = Day(newDate)
getYear = Year(newDate)
display date in (yyyy,mm,dd) format
newFormatDate = getYear & "/" & getMonth & "/" & getDay
response.write(newFormatDate)
will display the date as 2003/8/15 (yyyy,mm,dd)
if you need to display the 0's then just check the length of the month and day prior to assigning it to the getMonth and getDay variables.
something like this
Code:
if(Len(Month(newDate)) = 1) then
'month is 1 digit, place a zero in front of it
getMonth = "0" & Month(newDate)
else if(Len(Month(newDate)) = 2) then
'month is 2 digits
getMonth = Month(newDate)
end if