Set Default DateTime Format c#
Posted
by
Matthew Hood
on Stack Overflow
See other posts from Stack Overflow
or by Matthew Hood
Published on 2009-09-07T12:30:38Z
Indexed on
2012/04/02
5:28 UTC
Read the original article
Hit count: 206
Is there a way of setting or overriding the default DateTime format for an entire application. I am writing an app in C# .Net MVC 1.0 and use alot of generics and reflection. Would be much simpler if I could override the default DateTime.ToString() format to be "dd-MMM-yyyy". I do not want this format to change when the site is run on a different machine.
Edit - Just to clarify I mean specifically calling the ToString, not some other extension function, this is because of the reflection / generated code. Would be easier to just change the ToString output.
© Stack Overflow or respective owner