c# - String not getting converted to datetime -
i have have excel file getting date in string format "30-12-1899 07:50:00:am"
when trying convert datetime
giving error as
string not recognized valid datetime
i trying convert this
convert.todatetime(hometoschool[7],new datetimeformatinfo { shortdatepattern = "dd-mm-yyyy", dateseparator = "-" })
string mydate = "30-12-1899 07:50:00:am"; datetime dt1 = datetime.parseexact(mydate, "dd-mm-yyyy hh:mm:ss:tt", cultureinfo.invariantculture)
for more information date , time format strings,
Comments
Post a Comment