asp.net - Converting Date string to DateTime Format vb.net -
i have example , gives me exception "conversion string x datetime invalid"
here method validate datetime.
example date string : "27/03/1985"
public function validatedatecolumn(byref fieldname string) boolean try if isdate(fieldname) dim actualdate datetime = cdate(fieldname) dim dtlicexp datetime = cdate(actualdate.tostring("d", thread.currentthread.currentculture)) fieldname = dtlicexp.tostring("mm/dd/yyyy") return true end if catch ex exception 'fieldname &= "format must mm/dd/yyyy" return false end try end function
any idea validate date string formate datetime.
i want convert date "27/03/1985" datetime.
i'm using asp.net vb.net.
have @ using datetime.tryparseexact method or datetime.parseexact method
Comments
Post a Comment