Use DateTime.Parse:

Once you get the data from the db, do 
DateTime.Parse(DateTime.Now.ToShortDateString()).Date.ToShortDateStringd()

and just replace the DateTime.Now.ToShortDateString() with the date field name 
you want to get the DATE from.

Hth,
Karthick


-----Original Message-----
From: Mike Belcher
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 29, 2005 11:05 PM
To: [email protected]
Subject: [AspNetAnyQuestionIsOk] DateTime fields



I save the date a profile is updated in a date time field but for some
reason the time is 12:00:00 AM no matter what time you save although the
time element isn't even needed. I simply want the date to be pulled and
displayed but when I display the field in an aspx page it shows in this
format   8/28/2002 12:00:00 AM   it adds the 12:00:00 AM part each time
which isn't even the time it was saved anyway that is another issue. 


here is how I save the date when they update:
strp_updated = DateTime.Now().ToShortDateString()

How can I remove the time when it is displayed? And on another note how to
get the Correct time instead of 12:00:00 AM on each one??


Mike




 
Yahoo! Groups Links



 





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to