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

How to get and set Date & Time in RadDateTimePicker in "dd MMM yyyy hh:mm:ss" format

3 Answers 313 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Brijendra Kumar
Top achievements
Rank 1
Brijendra Kumar asked on 17 Dec 2008, 10:37 AM
Hi All,

I have taken a telerik:RadDateTimePicker control.
how to get or set its values in "dd MMM yyyy hh:mm:ss" format using javascript.
DOes anybody know then please tell me.

I will be highly greatful to yours!!!!!!!!!!!!


Regards
Brijendra Pandey

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 17 Dec 2008, 11:46 AM
Hello Brijendra,

Please try the following:
<script type="text/javascript" language="javascript"
    function setDateFormat() 
    { 
        var dateInput = $find('<%= RadDateTimePicker1.ClientID %>').get_dateInput(); 
        dateInput.set_displayDateFormat("dd MMM yyyy hh:mm:ss"); 
        dateInput.set_dateFormat("dd MMM yyyy hh:mm:ss"); 
    } 
</script> 

Let us know whether this helps.

Kind regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ram
Top achievements
Rank 1
answered on 12 Jul 2011, 03:38 PM
I Using RadDateTimepicker.
Following is my code.
<telerik:RadDateTimePicker ID="begnDate" runat="server"  Width="84%"  
         Height="10px" style="margin-top:-4px;"
         onselecteddatechanged="begnDate_SelectedDateChanged">
         <DateInput  DateFormat="dd/MM/yyyy hh:mm tt" runat="server" DisplayDateFormat="MM/dd/yyyy"/>
         <TimeView TimeFormat="t" runat="server" />
         <HideAnimation Type="Slide" />
         <ShowAnimation Type="Slide" />
         <DatePopupButton ImageUrl="../images/Cal_iconj.gif" HoverImageUrl="../images/Cal_iconj.gif"/>
         <TimePopupButton ImageUrl="../images/watch.gif" HoverImageUrl="../images/watch.gif"/>
         </telerik:RadDateTimePicker>
Here I need to set the date and time individually. means
When I selected calender i should get only date.like by using timer I should select Time.
I'm able to select only date but when I select the time that was not added to date (textbox).
How cloud i achieve this.
pls help me 
0
Daniel
Telerik team
answered on 18 Jul 2011, 09:06 AM
Hello Ram,

The display format of your RadDateTimePicker is declared in such way that only date is shown. You have to set it like this MM/dd/yyyy hh:mm tt in order to see the time value.

Regards,
Daniel
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
Calendar
Asked by
Brijendra Kumar
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Ram
Top achievements
Rank 1
Share this question
or