DateTime

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

VS .Net 2003 C#
Using DateTime.Now to capture System date and time and displaying it in a
user control (label). It works fine, but really only want to display the date
(not the time). Can anyone suggest what to do?

Thank You
 
DateTime.ToShortDateString() or you can create a custom format string to use
with DateTime.ToString().

The .Net Framework documentation on the DateTime.ToString() method has
several examples of format strings.

HTH

Dale Preston
MCAD, MCDBA, MCSE
 
VS .Net 2003 C#
Using DateTime.Now to capture System date and time and displaying it in a
user control (label). It works fine, but really only want to display the date
(not the time). Can anyone suggest what to do?

Thank You

string.Format("{0:MM/dd/yyyy}", DateTime.Now);



Otis Mukinfus
http://www.otismukinfus.com
 
Back
Top