2
Answers

string-was-not-recognized-as-a-valid-datetime error.

yashvant k

yashvant k

14y
6.3k
1
hi friends,

i am getting string-was-not-recognized-as-a-valid-datetime error.
  
IFormatProvider format = new CultureInfo("en-US");
string temp =tbxFrom.Text; // dd/MM/yyyy
DateTime nonIsd = DateTime.Parse(temp, format, DateTimeStyles.None);

locally this code work fine, but in live it shows me error.

Any idea please why its happen so.

Regards,
yash
Answers (2)