[Solved] String was not recognized as a valid DateTime from DateTimePicker

Assuming hdndate.Value is actually a string and its value is “28/04/2014”: Replace this: Convert.ToDateTime(hdndate.Value) With this: DateTime.ParseExact(hdndate.Value, “dd/MM/yyyy”, CultureInfo.InvariantCulture); DateTime.ParseExact allows you to specify the exact format of your input string, so that it can correctly generate a DateTime from it. In this case, your format is dd/MM/yyyy. solved String was not recognized as a … Read more

[Solved] How to solve the error convert String date from xml file to an int format?

The problem is in your lines DateFormat dfq = new SimpleDateFormat(“EEE MMM dd HH:mm:ss z yyyy”, Locale.FRENCH); Date date1 = dfq.parse(dateq); You got a ParseException because in ” Tue Feb 08 12:30:27 +0000 2011 ” you have leading and trailing space, and the parts Tue and Feb are English but not French. Change these lines … Read more