C# DateTime Constant
This is a post from the archives. I was super clever to share this!
See more archived posts in the archives.
In VB.NET, you could use a VB literal to define a constant. (date literals always use the American mm/dd/yyyy format)
Public Const CONSTANT_DATE As DateTime = #1/1/1501#
but in C#, no such thing exists. A simple workaround is to create a static readonly variable and assign it the desired date.
public static readonly DateTime CONSTANT_DATE = new DateTime(1501, 01, 01);