This is a migrated thread and some comments may be shown as answers.

[Solved] Removing of time in RadDatePicker value

1 Answer 191 Views
DatePicker for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Daniel
Top achievements
Rank 1
Daniel asked on 05 Feb 2013, 02:46 PM

Hi there,

After implementing the RadDatePicker, I was able to successfully obtain the value "3/5/2013 10:38:51 PM" upon doing a .Value

However, I would like to ask if it's possible to return the string without the time such as "3/5/2013". I had tried various ways but it seems that the new Windows 8 RadDatePicker seems to does things slightly different.

Much thanks if you are reading this! :)

1 Answer, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 08 Feb 2013, 09:02 AM
Hello Daniel,

You can get the date representation as string from the RadDatePicker.ValueString property or if you need to format it in a different way, you can use the RadDatePicker.Value property like this:
if (picker1.Value.HasValue)
{
    var s = picker1.Value.Value.ToString("M/d/yyyy");
}

Hope this helps.


Kind regards,
Giuseppe
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Tags
DatePicker for XAML
Asked by
Daniel
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Share this question
or