How Get Date From Date Picker In Diffrent Date Format

4 posts, 0 answers
  1. Chandan Kumar
    Chandan Kumar avatar
    68 posts
    Member since:
    Mar 2010

    Posted 14 Jul 2010 Link to this post


        How can i get diffrent date format from Date Picker.

    For Example if  Date Time Picker Format is "dd/MM/yyyy" and i want to get Its "yyyy/MM/dd" format. How can i get it.

    1 more Problem when raddate time picker i set date format "MM/dd/yyyy hh:mm" Then It shows month in single digit format.

    Means When Date is "07/15/1986" Then It autometicaly converted "7/15/1986" So i want two digit in month Format.

    Please Help Me .


  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 14 Jul 2010 Link to this post


    You can format the selected date from code behind as shown below.

    string str = RadDateTimePicker1.SelectedDate.Value.ToString("yyyy/MM/dd");

    And for displaying the DateFormat, try setting the DisplayDateFormat for the RadDateTimePicker ->  DateInput.
    <telerik:RadDateTimePicker ID="RadDateTimePicker1" runat="server">
        <DateInput DateFormat="MM/dd/yyyy hh:mm" DisplayDateFormat="MM/dd/yyyy hh:mm">

  3. Chandan Kumar
    Chandan Kumar avatar
    68 posts
    Member since:
    Mar 2010

    Posted 14 Jul 2010 Link to this post

        <DateInputDateFormat="MM/dd/yyyy hh:mm"DisplayDateFormat="MM/dd/yyyy hh:mm">

    I Have already put this code but its working But problem is as below.

    it display as "7/15/1985 10:15"

    it should display as "07/15/1985 10:15"

    it dispaly month in single digit. please help me.
  4. Radoslav
    Radoslav avatar
    1566 posts

    Posted 19 Jul 2010 Link to this post

    Hi Chandan,

    I try to reproduce the described issue, but to no avail. On the following link I uploaded the video which shows the described scenario, however the date string is set as expected.
    Additionally I am sending you a simple example, could you please check it out and let me know what differs in your case.

    Sincerely yours,
    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
Back to Top