Hi,
I'm using DatePicker and I want achieve few modifications in the date format. I want the date format like dd-mm-yyyy but in datepicker i'm getting dd/mm/yyyy. I have given the DateRangeSeperator = "-" but its not working. Also I want to remove to time stamp after date. Any help would be appreciated.
I'm using DatePicker and I want achieve few modifications in the date format. I want the date format like dd-mm-yyyy but in datepicker i'm getting dd/mm/yyyy. I have given the DateRangeSeperator = "-" but its not working. Also I want to remove to time stamp after date. Any help would be appreciated.
4 Answers, 1 is accepted
0

Shinu
Top achievements
Rank 2
answered on 08 Jul 2010, 02:41 PM
Hi Nisha,
You can achieve this by setting properties: DateFormat and DisplayDateFormat
ASPX:
-Shinu.
You can achieve this by setting properties: DateFormat and DisplayDateFormat
ASPX:
<
telerik:RadDatePicker
ID
=
"RadDatePicker1"
runat
=
"server"
>
<
DateInput
DateFormat
=
"dd-MM-yyyy"
DisplayDateFormat
=
"dd-MM-yyyy"
>
</
DateInput
>
</
telerik:RadDatePicker
>
-Shinu.
0

nisha
Top achievements
Rank 1
answered on 09 Jul 2010, 05:52 AM
Hi Shinu,
Thanks for the reply, I'm getting the required date format. But in code behind when I retrieve the value of that textbox, it should be in the same format. For eg, I have given
string date = RadDatePicker1.SelectedDate.ToString();
output for date is "19/01/2009 12:00:00 AM"
I want it as "19-01-2009"
How do I achieve this?
Thanks for the reply, I'm getting the required date format. But in code behind when I retrieve the value of that textbox, it should be in the same format. For eg, I have given
string date = RadDatePicker1.SelectedDate.ToString();
output for date is "19/01/2009 12:00:00 AM"
I want it as "19-01-2009"
How do I achieve this?
0

Shinu
Top achievements
Rank 2
answered on 09 Jul 2010, 08:40 AM
Hello Nisha,
You can do it from code behind. Have a look at the following code.
C#:
string date1 = RadDatePicker1.SelectedDate.Value.ToString("dd-MM-yyyy");
-Shinu.
You can do it from code behind. Have a look at the following code.
C#:
string date1 = RadDatePicker1.SelectedDate.Value.ToString("dd-MM-yyyy");
-Shinu.
0

nisha
Top achievements
Rank 1
answered on 10 Jul 2010, 05:15 AM
Thanks a lot :)