Tuesday, 2 May 2017

7.jquery current Indian date in dd/mm/yyyy format and time in H:m:s

var d            = new Date();
    var curr_date    = d.getDate();
    var curr_month   = ("0" + (d.getMonth() + 1)).slice(-2);
    var curr_year    = d.getFullYear();
    var current_date =curr_date + ":" + curr_month + ":" + curr_year;
 
    var current_time =  + d.getHours() + ":"  + d.getMinutes() + ":" + d.getSeconds();

No comments:

Post a Comment