I am developing a ASP.NET C# Webforms website with MySQL as the database supplying dates in its standard date format.
How can I add a custom date format to the Global.asax.cs file like the follow (non-working code):
using System.Globalization;
using System.Threading;
protected void Application_BeginRequest(Object sender, EventArgs e)
{
CultureInfo newCulture = (CultureInfo) System.Threading.Thread.CurrentThread.CurrentCulture.Clone();
//Will make all dates of the format similar to 3/14/13 12:9 AM/PM
newCulture.DateTimeFormat = "M/d/yy h:m tt";
Thread.CurrentThread.CurrentCulture = newCulture;
}
Thank you for any input.