ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Error: String was not recognized as a valid DateTime in IIS Server in ASP.NetHi @manoj150,<br />Please try the following<br /><br /><a href = 'link(Threads/182381/String-was-not-recognized-as-a-valid-DateTime/)'>String was not recognized as a valid DateTime.</a><br /><br />It might help you.<br /><br />Cheers Andrea.https://www.aspforums.net:443/Threads/612390/Error-String-was-not-recognized-as-a-valid-DateTime-in-IIS-Server-in-ASPNet/https://www.aspforums.net:443/Threads/612390/Error-String-was-not-recognized-as-a-valid-DateTime-in-IIS-Server-in-ASPNet/Mon, 16 Jan 2017 07:30:35 GMTError: String was not recognized as a valid DateTime in IIS Server in ASP.Net<p>Hi <a class="username" rel="manoj150"> manoj150</a>,</p> <p>Your custom format is wrong. Use DateTime.ParseExact method, your format and string should match exactly.</p> <pre class="brush: csharp">var manDate = DateTime.ParseExact(txtManDate.Text, &#34;MM/dd/yyyy&#34;, System.Globalization.CultureInfo.InvariantCulture); DateTime dt2 = Convert.ToDateTime(manDate); var expDate = DateTime.ParseExact(txtExpDate.Text, &#34;MM/dd/yyyy&#34;, System.Globalization.CultureInfo.InvariantCulture); DateTime dt3 = Convert.ToDateTime(expDate);</pre> <p>After you parse your string, you can format whatever format you want with DateTime.ToString() method.</p>https://www.aspforums.net:443/Threads/612390/Error-String-was-not-recognized-as-a-valid-DateTime-in-IIS-Server-in-ASPNet/https://www.aspforums.net:443/Threads/612390/Error-String-was-not-recognized-as-a-valid-DateTime-in-IIS-Server-in-ASPNet/Mon, 16 Jan 2017 07:57:44 GMTError: String was not recognized as a valid DateTime in IIS Server in ASP.Net<p>This is not working any other method..??</p> <p>same error.</p>https://www.aspforums.net:443/Threads/612390/Error-String-was-not-recognized-as-a-valid-DateTime-in-IIS-Server-in-ASPNet/https://www.aspforums.net:443/Threads/612390/Error-String-was-not-recognized-as-a-valid-DateTime-in-IIS-Server-in-ASPNet/Mon, 16 Jan 2017 08:01:37 GMTError: String was not recognized as a valid DateTime in IIS Server in ASP.Net<p>Hi <a class="username" rel="manoj150"> manoj150</a>,</p> <p>1) Change the datetime format of your server from<br /><br />Control Panel -&gt; Regional and Language Options -&gt; Advanced</p> <p>2) Open IIS and follow below steps:</p> <ul style="list-style-type: disc;"> <li>&nbsp;Click on you Website</li> <li>&nbsp;Select .NET GLOBALIZATION option</li> <li>&nbsp;From Culture tab, select required Culture and UI Culture.</li> <li>&nbsp;Finally iisreset.</li> </ul>https://www.aspforums.net:443/Threads/612390/Error-String-was-not-recognized-as-a-valid-DateTime-in-IIS-Server-in-ASPNet/https://www.aspforums.net:443/Threads/612390/Error-String-was-not-recognized-as-a-valid-DateTime-in-IIS-Server-in-ASPNet/Mon, 16 Jan 2017 09:46:55 GMT