c# datetime only year month day code example
Example 1: c# @datetime show only year
<footer class="border-top footer text-muted">
<div class="container">
© @DateTime.UtcNow.Year - Home <a asp-area="" asp-controller="Home" asp-action="Privacy"></a>
</div>
</footer>
Example 2: get day month year from date c#
// can add : or / to seperate dates and time
DateTime.Now.ToString("yyyyMMddhhmmss")