
Tim Anderson
Top achievements
Rank 1
Tim Anderson
asked on 09 Jun 2008, 01:24 AM
Am I missing something?
On the DateTimePicker and TimePicker you can easily set the TimeView.TimeFormat to something like "HH:mm:ss", to cause the TimePicker popup to display values like "23:00:00", but the textbox for the control still displays values like "6/8/2008 11:00 PM".
I would like the "11:00 PM" to display as "23:00:00" so the user can adjust down to the second, if needed.
Where is that format set?
Thanks!
On the DateTimePicker and TimePicker you can easily set the TimeView.TimeFormat to something like "HH:mm:ss", to cause the TimePicker popup to display values like "23:00:00", but the textbox for the control still displays values like "6/8/2008 11:00 PM".
I would like the "11:00 PM" to display as "23:00:00" so the user can adjust down to the second, if needed.
Where is that format set?
Thanks!
5 Answers, 1 is accepted
0

Baatezu
Top achievements
Rank 2
answered on 09 Jun 2008, 03:43 AM
The RadDateTimePicker.DateInput.DisplayDateFormat needs to be changed. I assume you know what they need to be set to to display in 24 hour with seconds. I did a quick demo site to find a solution, this is what I have in the ASPX
for my RadDateTimePicker. It shows the time in 24 with seconds after they have selected.
Hope that helps.
<telerik:RadDateTimePicker ID="RadDateTimePicker1" Runat="server" |
Culture="English (United States)"> |
<TimeView TimeFormat="HH:mm:ss"> |
</TimeView> |
<DateInput InvalidStyleDuration="100" DisplayDateFormat="M/d/yyyy HH:mm:ss"></DateInput> |
</telerik:RadDateTimePicker> |
Hope that helps.
0

Tim Anderson
Top achievements
Rank 1
answered on 09 Jun 2008, 04:18 AM
Thanks, Baatezu -
That gets me closer. (The help files seem to be missing these TimePicker controls and I didn't dig deep enough into Intelisense to find RadDateTimePicker.DateInput.DisplayDateFormat.)
With your changes, the DateTimePicker now displays the correct format, but only if you set the value in code, or after selecting a Date or a Time from the respective pop-ups.
When you click on the DateInput text box to edit it directly, it immediately reverts to the original format.
For example, I set the control to DateTime.Now and it shows "6/8/2008 21:14:53" - as soon as I click on it to edit it, it says "6/8/2008 9:14 PM", so I can't adjust the seconds.
Both the RadDateTimePicker and RadTimePicker behave this way.
That gets me closer. (The help files seem to be missing these TimePicker controls and I didn't dig deep enough into Intelisense to find RadDateTimePicker.DateInput.DisplayDateFormat.)
With your changes, the DateTimePicker now displays the correct format, but only if you set the value in code, or after selecting a Date or a Time from the respective pop-ups.
When you click on the DateInput text box to edit it directly, it immediately reverts to the original format.
For example, I set the control to DateTime.Now and it shows "6/8/2008 21:14:53" - as soon as I click on it to edit it, it says "6/8/2008 9:14 PM", so I can't adjust the seconds.
Both the RadDateTimePicker and RadTimePicker behave this way.
0
Accepted

Baatezu
Top achievements
Rank 2
answered on 09 Jun 2008, 04:33 AM
RadDateTimePicker.DateInput.DateFormat set to the same thing as DisplayDateFormat fixed that for me.
0

Tim Anderson
Top achievements
Rank 1
answered on 09 Jun 2008, 04:48 AM
That did the trick.
Works for both RadDateTimePicker and RadTimePicker from either .aspx or code-behind, but both properties need to be set.
Thanks again!
Works for both RadDateTimePicker and RadTimePicker from either .aspx or code-behind, but both properties need to be set.
Thanks again!
0

sgrover
Top achievements
Rank 1
answered on 15 Sep 2018, 12:39 PM
And for me. Cheers