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

24hour format in RadDateTimePicker

3 Answers 786 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Luis
Top achievements
Rank 1
Luis asked on 18 Feb 2014, 05:24 PM
Hello Guys!
I have a problem, I've a RadDateTimePicker , but the format date its something like this 19/02/2014 12:00:00 a.m. but the follow format: 2014-02-18 11:00:26.293
anyone knows How Can I do this?
thanks and regards,
Luis.

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 19 Feb 2014, 03:10 AM
Hi Luis,

Please try the following code snippet to achieve your scenario.

ASPX:
<telerik:RadDateTimePicker ID="RadDateTimePicker2" runat="server" Culture="English (United States)">
    <TimeView TimeFormat="HH:mm:ss.fff" runat="server">
    </TimeView>
    <DateInput DisplayDateFormat="yyyy-MM-dd HH:mm:ss.fff" runat="server">
    </DateInput>
</telerik:RadDateTimePicker>

Thanks,
Shinu.
Anatoly
Top achievements
Rank 1
Iron
commented on 25 Dec 2023, 01:41 AM

Hi Shinu,

I have issue with adding minutes.

After I set "12/2/2023 3:00" to RadDateTimePicker - I want to add 5 minutes in order to get  "12/2/2023 3:05"

But data is not changing.

This is my code :

DateTime date = {12/2/2023 3:00 PM} ( it was set to RadDateTimePicker )

string SelectedDate = date.ToString("yyyy-MM-dd"); 
string SelectedTime = date.ToString("HH:mm");

double minutes = Convert.ToDouble(RadDropDownList.SelectedText);
date.AddMinutes(minutes);  <- this statement does not add 5 minutes: The date remains as "12/2/2023 3:00"

Please help.

Regards, Anatoly

 

Attila Antal
Telerik team
commented on 27 Dec 2023, 03:42 PM

Hi Anatoly,

I already replied to your support ticket regarding this issue, but I will also share the message in this forum thread:

I've tried increasing the Current selected Date by 5 minutes and it is working as expected.

if (RadDateTimePicker1.SelectedDate != null)
{
    RadDateTimePicker1.SelectedDate = RadDateTimePicker1.SelectedDate.Value.AddMinutes(5);
}

If this does not work for you, there might be other reasons for that.

If you have AJAX enabled either by using (AjaxManager, AjaxPanel, or asp:UpdatePanel), remove them temporarily and test the application again. This will prevent the AJAX from hiding the server exceptions and show the exception in detail if those are generated.

To be able to tell you more, we would need to see the complete implementation of the DateTimePicker as well as share with us the code that changes the date (including the function name). We need to understand which event of the Page's LifeCycle Event is being used for that. 

0
a a
Top achievements
Rank 1
answered on 08 Apr 2020, 06:32 PM

not working for me, see picture, pls help, thanks:

<telerik:RadDateTimePicker ID="RadDateTimePicker2" runat="server" Culture="English (United States)">
    <TimeView TimeFormat="HH:mm:ss.fff" runat="server">
    </TimeView>
    <DateInput DisplayDateFormat="yyyy-MM-dd HH:mm:ss.fff" runat="server">
    </DateInput>
</telerik:RadDateTimePicker>

 

 

0
Doncho
Telerik team
answered on 10 Apr 2020, 04:41 PM

Hi,

Telerik RadDatePicker uses RadCalendar underneath and that has its own formatting pattern, see Date Format Patterns. That is the reason the The "fff" custom format specifier did not apply in your case.

For more information on Formatting the Date in the Calendar, please check out the following articles:

Kind regards,
Doncho
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Calendar
Asked by
Luis
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
a a
Top achievements
Rank 1
Doncho
Telerik team
Share this question
or