Created
March 24, 2016 14:21
-
-
Save mii9000/5ff83183581d8497f528 to your computer and use it in GitHub Desktop.
Set datetime of a culture application wide
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void Application_BeginRequest(Object sender, EventArgs e) | |
{ | |
//Set Custom Culture | |
CultureInfo newCulture = (CultureInfo)System.Threading.Thread.CurrentThread.CurrentCulture.Clone(); | |
newCulture.DateTimeFormat.ShortDatePattern = "dd/MM/yyyy"; | |
newCulture.DateTimeFormat.DateSeparator = "/"; | |
Thread.CurrentThread.CurrentCulture = newCulture; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment