Click here to Skip to main content
15,891,864 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am working on a WPF project with a datepicker and I can't seem to figure out how to eliminate the time stamp from the output. I only need the .SelectedDate returned.

In my code I am converting the date to a string
VB
if DatePicker1.ToString <> "" then

My problem is that the returned string is "2/25/2013 12:00:00 AM"
I only wish to get "2/25/2013" without the time code.
How do I do this?
Posted
Updated 25-Feb-13 6:06am
v2
Comments
Richard C Bishop 25-Feb-13 11:40am    
That is not a question. Please elaborate and be specific when asking your question.

I wasn't able to delete the solution, but here is an update "I solved it myself" solution...
VB
If DatePicker1.ToString <> "" Then qq = Left(DatePicker1.ToString, Len(DatePicker1.ToString) - 11) : PutText("DATEIN")
 
Share this answer
 
v2
Comments
CHill60 25-Feb-13 12:09pm    
You've posted this as a Solution instead of using the Improve Question link. As this is your own posting you should be able to delete this solution - otherwise no one will see it as requiring an answer
Use String.Format() or something like
Me.DateTimePicker1.Value.ToString("dd/MM/yyyy")
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900