I have formatted a string date into date format
by using
<script type="text/javascript">
var st = "26-04-2013";
var pattern = /(\d{2})\-(\d{2})-(\d{4})/;
var dt = new Date(st.replace(pattern,'$3-$2-$1'));
alert(dt);
</script>
and it's output is
Fri Apr 26 2013 05:30:00 GMT+0530 (IST)
but I want out put as 2013-04-26
how can i do this in JS?
urgent please :(