C# DATETIME CONSTANT

Added on 2013-02-15 Under:

In VB.NET, you could use a VB Date literal to define a constant. (Side Note, VB 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);