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

REmove TimePart from datetime

2 Answers 197 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
bob thomash
Top achievements
Rank 1
bob thomash asked on 16 Sep 2010, 11:30 AM
 Hello Friends !

I m working 2010 telerik controls in silverlight 4.0 .
I m using RadDatePicker.When i select the date the value coming like "9/14/2010 12:00:00 AM " I want to remove the time part from datetime.i want value "9/14/2010" in DateTime format.(Not string format like ToShortDatetime())

Bob thomash
USA

2 Answers, 1 is accepted

Sort by
0
George
Telerik team
answered on 16 Sep 2010, 03:13 PM
Hello Bob,

SelectedValue property is type of DateTime? and it cannot return only the date part of the value, it returns the time as well. 

I hope this helps. I will be glad to assist you further.

Greetings,
George
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Michael
Top achievements
Rank 1
answered on 13 Jun 2018, 10:10 AM
If we get the actual DateTime object behind the nullable DateTime we can then format it as we wish:

 
if (RadDatePicker1.SelectedDate.HasValue)
    startdate = RadDatePicker1.SelectedDate.Value.ToString("dd/MM/yyyy");
Tags
DatePicker
Asked by
bob thomash
Top achievements
Rank 1
Answers by
George
Telerik team
Michael
Top achievements
Rank 1
Share this question
or