how to display a date as 2/25/2007 format in javascript, if i have date object
Your best option for all users (internationally) is toLocaleDateString
.
var date = new Date("2007-02-25 01:00:00"); // for some reason a time is needed
var dateString = date.toLocaleDateString();
console.log(dateString); // outputs 2/25/2007
Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString