Welcome Guest Search | Active Topics | Sign In | Register

Date Picker Options
Deven
Posted: Wednesday, September 3, 2008 2:12:33 PM
Rank: Newbie
Groups: Member

Joined: 8/28/2008
Posts: 1
When user selects date from Date Picker and submits the form, it seems like it also stamps time (Desire Service Date: 9/4/2008 12:00:00 AM). How do I remove the time stamp? I just need selected date.

In my ASP.Net (VB form), I am using following line of code to capture selected date.

ddlDesireServiceDate.SelectedDate.ToString

Thanks
Deven
eo_support
Posted: Wednesday, September 3, 2008 2:20:56 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,090
Hi,

SelectedDate is of DateTime type. A DateTime value as the name implied, always contains both date and time value. The difference is which part you use/care. Since the value is always there, when you call ToString, it gives you both by default.

To get the date/time value in different format, you would pass ToString a format string. For example, ToString("d") would only give you date part ("9/4/2008").

Many standard and custom format strings are supported. Note they are implemented by .NET frameworks, not by us. You can find the details about format strings from the following MS documentation:

http://msdn.microsoft.com/en-us/library/az4se3k1.aspx

http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx

Hope this helps.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.