% '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 'this is a function to validate the date field. 'instruction:- '1) include this file to your asp file ' ' '2) in your date field ' eg: <% 'use for ListReceiveJobK1 and ListReceiveJobK2, ListSendEFT.asp function ValidateDate if session("startDate")="" and session("dateEnd")="" then if Request.Form("endDate") = "" then dateC = "January 19,2010" dateEnd = cdate(dateC) else dateEnd = cdate(Request.Form("endDate")) end if dayE = day(dateEnd) monthE = month(dateEnd) yearE = year(dateEnd) dateEnd = dayE&"/"&monthE&"/"&yearE if Request.Form("startDate") = "" then dateA = "January 19,1900" dateB = CDate(dateA) dateB = day(dateB)&"/"&month(dateB)&"/"&year(dateB) session("startDate") = month(dateB)&"/"&day(dateB)&"/"&year(dateB) session("dateEnd") = month(dateEnd) &"/"&day(dateEnd)&"/"&year(dateEnd) else dateA = cdate(Request.Form("startDate")) dateA = day(dateA)&"/"&month(dateA)&"/"&year(dateA) session("startDate") = month(dateA)&"/"&day(dateA)&"/"&year(dateA) session("dateEnd") = month(dateEnd) &"/"&day(dateEnd)&"/"&year(dateEnd) end if end if end function 'this function is use to make sure the date is in mm/dd/yyyy format 'i put in process file eg.saving, editing mostly on declaration part function VDate(dateI) if not(isNull(dateI) or dateI = "") then dateI = day(dateI)&"/"&month(dateI)&"/"&year(dateI) dateI = month(dateI)&"/"&day(dateI)&"/"&year(dateI) VDate = dateI else VDate = "" end if end function 'this function is use to make date format in dd/mm/yyyy function TDate(DateValue) if not(isNull(DateValue) or DateValue = "") then dateJ = day(DateValue)&"/"&month(DateValue)&"/"&year(DateValue) TDate = dateJ else TDate = "" end if end function 'Function TransformDate(i) ' YD = year(i) ' MD = month(i) ' DD = day(i) ' TransformDate = DD&"/"&MD&"/"&YD 'end function Function TransformDate(i) if i <>"" then YD = year(i) if (len(month(i))<2) then MD = "0"&month(i) else MD = month(i) end if if(len(day(i))<2) then DD = "0"&day(i) else DD = day(i) end if TransformDate = DD&"/"&MD&"/"&YD end if end function Function TransformTime(o) H = Hour(o) M = Minute(o) S = Second(o) TransformTime = H &":"& M &":"& S end function %>