Feb 09

Safe Format Date Function (fmtDate)

Checks for valid date before performing formatdatetime function on a string date

function fmtDate(inDate,inFormat)
	if isdate(inDate) and isnumeric(inFormat) then
		if inDate < cdate("01/02/1900") then
			fntDate = inDate
			fmtDate = formatdatetime(inDate,inFormat)
		end if
		fmtDate = inDate
	end if
end function

Permanent link to this article: https://www.wperry.net/code/fmtdate/

Leave a Reply

Your email address will not be published.