Fetching date in different format

2 posts, 1 answers
  1. Joseph
    Joseph avatar
    21 posts
    Member since:
    Mar 2013

    Posted 22 Mar 2013 Link to this post

    Hi

    There is a raddatepicker in my order page which is in yyyy-mm-dd format. How to fetch the date from raddatepicker in MM-DD-YYYY format using javascript?

    Thanks in advance,
    Joseph.
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 22 Mar 2013 Link to this post

    Hi Joseph,

    Please try the following code snippet.

    JavaScript:
    <script type="text/javascript">
        function getDate() {
            var datePicker = $find("<%=RadDatePicker1.ClientID %>");
            var dt = datePicker.get_dateInput().get_selectedDate().format("MM/dd/yyyy");
            alert(dt);
        }
    </script>

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top