DateTime.Now.ToShortDateString() and DateTime.Now.ToLongDateString() are methods that return the current culture date format. The string returned by the ToShortDateString and ToLongDateString methods are culture-sensitive. It reflects the pattern defined by the current culture’s date format. You can get the current culture date format by using either of the following methods.
<h2>@DateTime.Now.ToShortDateString()</h2>
or
<h2>@DateTime.Now.ToLongDateString()</h2>
Share with