MVC Razor Dates
How many ways can we format a date...
If it is already a Date or DateTime type
@item.ContributedDate.ToShortDateString()
If is is a Nullable Date or DateTime type
@if (item.ExpirationDate != null)
{
@item.ExpirationDate.Value.ToString("d")
}
If it is already a Date or DateTime type
@item.ContributedDate.ToShortDateString()
If is is a Nullable Date or DateTime type
@if (item.ExpirationDate != null)
{
@item.ExpirationDate.Value.ToString("d")
}
Comments