by bugor (5 Submissions)
Category: Active Server Pages
Compatability: ASP (Active Server Pages)
Difficulty: Unknown Difficulty
Originally Published: Tue 20th November 2001
Date Added: Mon 8th February 2021
Rating: (2 Votes)
formating Date for Web
if Not IsDate(sDate) then exit function
sYear=Year(sDate)
if Len(sYear)<3 then sYear="20" & sYear
sMonth=Month(sDate)
if Len(sMonth)<2 then sMonth="0" & sMonth
sDay=Day(sDate)
if Len(sDay)<2 then sDay="0" & sDay
sDate=sYear & "-" & sMonth & "-" & sDay 'you can change sequence of arguments and delimiter
GetDate=sDate
end function