How to get Only Date part from of selected date in RadDatePicker

6 posts, 0 answers
  1. Manish
    Manish avatar
    64 posts
    Member since:
    Jul 2011

    Posted 29 Sep 2011 Link to this post

    Hi,

    I am using Raddatepicker and i want to select only Date part from the that textbox.
     i using like this DatePicker.SelectedDate

    Like:  currently comming : 9/29/2011 12:00:00 AM

             required : 9/29/2011 or 09/29/2011.

    and i want to pass in my method '09/29/2011' but Passing going '9/29/2011 12:00:00 AM


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

    Posted 29 Sep 2011 Link to this post

    Hello Manish,

    You can set the DateFormat as follows.
    aspx:
    <telerik:RadDatePicker ID="RadDatePicker 1" DateInput-DateFormat="MM/dd/yyyy">
    </telerik:RadDatePicker>

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Manish
    Manish avatar
    64 posts
    Member since:
    Jul 2011

    Posted 29 Sep 2011 Link to this post

    This is not working for me. Actually i need to send it
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 11 Oct 2011 Link to this post

    Hello Manish,

    You can try the following approach to get the Date from the DateTime object.
    C#:
    protected void RadDatePicker1_SelectedDateChanged1(object sender, Telerik.Web.UI.Calendar.SelectedDateChangedEventArgs e)
      {
          DateTime dt =Convert.ToDateTime( RadDatePicker1.SelectedDate);
          string  temp = dt.ToShortDateString();
      }

    Thanks,
    Shinu.
  6. Irving
    Irving avatar
    12 posts
    Member since:
    Jan 2014

    Posted 04 Jun 2014 in reply to Shinu Link to this post



     
          DateTime dt =Convert.ToDateTime( RadDatePicker1.SelectedDate);
          string  temp = dt.ToShortDateString();
     


    This works thanks ^^
  7. Manish
    Manish avatar
    1 posts
    Member since:
    Jun 2016

    Posted 15 Jul Link to this post

    Try this...

     DateTime? toDate = new DateTime();
     toDate = dtToDate.SelectedDate;

    string toStringValue= toDate.Value.ToString("MM/dd/yyyy");

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017