こんにちはちょうどあなたのニーズに従ってJSコードをフォロー
<script>
function convertDate(inputFormat)
{
function pad(s) { return (s < 10) ? '0' + s : s; }
var d = new Date(inputFormat);
return [pad(d.getDate()), pad(d.getMonth()+1), d.getFullYear()].join('/');
} // This is a Fuction For Convert Your Date into dd/mm/yyyy Format
var today = new Date(); // Eg. Wed Apr 29 2016 17:07:18 GMT+0530 (India Standard Time)
var a = convertDate(today); // It Will Convert Your Date By calling Above Function
alert(a); // 02/05/2016
var pastDate = today.setFullYear(today.getFullYear() - 1);
var b = convertDate(pastDate);
alert(b); // 02/05/2015
$("#date-picker input").datepicker({format: 'dd/mm/yyyy'}).datepicker("setDate", pastDate); //Set newDate in your DatePicker what ever you want .
</script>
は、あなたが使用できるいくつかの余分な日付時刻関連の関数は((使用しています過去および未来のタイミングニーズに応じて)
**Method** **Description**
getDate() Returns the day of the month (from 1-31)
getDay() Returns the day of the week (from 0-6)
getFullYear() Returns the year (four digits)
getHours() Returns the hour (from 0-23)
getMilliseconds() Returns the milliseconds (from 0-999)
getMinutes() Returns the minutes (from 0-59)
getMonth() Returns the month (from 0-11)
getSeconds() Returns the seconds (from 0-59)
また、詳細については、モジラの開発者ネットワークにDate - JavaScript _ MDN
そしてW3SchoolsのJavaScript Datesを参照してください
日付形式dd/mm/yyyyy –
@rameshbogandla更新された回答を参照 – RRK