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.Show date with time in PersianCalendar format in C#<p>Hi nedash,</p> <p>can you tell how your date time is getting saved in database i.e Format of saving.For eg (2016/05/10 15:25:15) some kind.</p>https://www.aspforums.net:443/Threads/125557/Show-date-with-time-in-PersianCalendar-format-in-C/https://www.aspforums.net:443/Threads/125557/Show-date-with-time-in-PersianCalendar-format-in-C/Mon, 24 Oct 2016 02:00:53 GMTShow date with time in PersianCalendar format in C#hi anandM it is like: 2016-10-22 20:18:04.350https://www.aspforums.net:443/Threads/125557/Show-date-with-time-in-PersianCalendar-format-in-C/https://www.aspforums.net:443/Threads/125557/Show-date-with-time-in-PersianCalendar-format-in-C/Mon, 24 Oct 2016 05:18:37 GMTShow date with time in PersianCalendar format in C#<p>Hi nedash,</p> <p>Replace your code with below&nbsp;</p> <pre class="brush: csharp">public string miladitoshamsi(object miladi1) { DateTime miladi = Convert.ToDateTime(miladi1); System.Globalization.PersianCalendar shamsi = new System.Globalization.PersianCalendar(); return string.Format(&#34;{0}/{1}/{2} {3}:{4}:{5}.{6}&#34;, shamsi.GetYear(miladi), shamsi.GetMonth(miladi), shamsi.GetDayOfMonth(miladi), shamsi.GetHour(miladi), shamsi.GetMinute(miladi), shamsi.GetSecond(miladi), shamsi.GetMilliseconds(miladi)); }</pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/125557/Show-date-with-time-in-PersianCalendar-format-in-C/https://www.aspforums.net:443/Threads/125557/Show-date-with-time-in-PersianCalendar-format-in-C/Mon, 24 Oct 2016 05:42:29 GMTShow date with time in PersianCalendar format in C#<p>this error happen</p> <h1>Server Error in '/' Application.</h1> <hr size="1" width="100%" /> <h2><em>Compilation Error</em></h2> <p><font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif "> <strong> Description: </strong>An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. <br /><br /> <strong> Compiler Error Message: </strong>CS0161: 'Admin_NewOrder.miladitoshamsi(object)': not all code paths return a value<br /><br /> <strong>Source Error:</strong></font></p>https://www.aspforums.net:443/Threads/125557/Show-date-with-time-in-PersianCalendar-format-in-C/https://www.aspforums.net:443/Threads/125557/Show-date-with-time-in-PersianCalendar-format-in-C/Mon, 24 Oct 2016 05:55:22 GMTShow date with time in PersianCalendar format in C#<p>Hi nedash,</p> <p>I have modified my code please have go through it</p> <p><a href="http://www.aspforums.net/Threads/125557/show-date-with-time/Replies/3#Replies">http://www.aspforums.net/Threads/125557/show-date-with-time/Replies/3#Replies</a></p>https://www.aspforums.net:443/Threads/125557/Show-date-with-time-in-PersianCalendar-format-in-C/https://www.aspforums.net:443/Threads/125557/Show-date-with-time-in-PersianCalendar-format-in-C/Mon, 24 Oct 2016 06:02:30 GMT