Quantcast
Viewing latest article 30
Browse Latest Browse All 42

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

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 latest article 30
Browse Latest Browse All 42

Trending Articles