javascript ubah ubah date tgl

var start_permanen_date = $("#start_permanen_date").val();

     alert(start_permanen_date);

     var thn = new Date(new Date().setYear(new Date().getFullYear() + 1))
     //var thn1 =

     // var myDate = new Date();
     // alert(myDate.getFullYear() + 1);

     //  var myDate1 = new Date();
     // alert(myDate1.getFullMonth() + 1);


     //test

       var stop_date = $(this).val();
       var potong = stop_date.split('-');
                var day1 = new Date(potong[2]+'/'+potong[1]+'/'+potong[0]);
              day1.setDate(day1.getDate() + 1);
       var thn1 = day1.getFullYear() + 50;
       var day111 = ("0" + (day1.getDate()-1)).slice(-2) ;
            var futDate=  day111 + "-" +  ("0" + (day1.getMonth()+1)).slice(-2) + "-" + thn1;
            //alert(futDate+'futDate');
     //24-05-2016
     var myDate = new Date();
     NextYear = myDate.getFullYear()+ 1;
     new1 = myDate.getMonth()+1 + "-" +myDate.getDate() + "-" + NextYear ;
     alert(new1+'vvv');

0 Response to "javascript ubah ubah date tgl"

Posting Komentar