时间戳转化为时间:
$scope.getLocalTime = function (n) { return new Date(n).toLocaleDateString(); };
时间转化为时间戳:
var date = new Date(); // 当前时间 console.log(date.getTime()); var d2 = new Date(2018,4,23); console.log(d2.getTime());
时间戳转化为时间:
$scope.getLocalTime = function (n) { return new Date(n).toLocaleDateString(); };
时间转化为时间戳:
var date = new Date(); // 当前时间 console.log(date.getTime()); var d2 = new Date(2018,4,23); console.log(d2.getTime());