Current Datetime function in Javascript | Techbirds

Posted on: February 4, 2014 /

Categories: PHP / Author Name: Diksha Verma

(Current Datetime) function in Javascript

function getCurrentTime()

{

var dt = new Date();

return dt.getFullYear()+”-”+(’0′ + (dt.getMonth()+1)).slice(-2)+”-”+ (’0′ + dt.getDate()).slice(-2)+” “+ (’0′ + dt.getHours()).slice(-2)+”:”+(’0′ + dt.getMinutes()).slice(-2);

}

428 total views, 2 views today

Share this Onfacebook-5146823twitter-1677722linkedin-4556396google-1023786