Quantcast
Channel: How to remove time portion of date in C# in DateTime object only? - Stack Overflow
Viewing all articles
Browse latest Browse all 42

Answer by John for How to remove time portion of date in C# in DateTime object only?

$
0
0

Came across this post when trying to solve the original Q.

I am using Asp.Net and after some research I have found when you are binding to the value of the date in code behind, you can drop the time so it will not display on screen.

C#:

DateTime Today = DateTime.Now;

aspx:

<%: this.Today.ToShortDateString() %>

Viewing all articles
Browse latest Browse all 42

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>