js中没有类似java中的DateFormat类来处理日期格式化,可以自己写一个: var newDate=new Date(); var year=newDate.getFullYear(); var month=(newDate.getMonth()+1)<10?"0"+(newDate.getMonth()+1):newDate.getMonth()+1; var day=newDate.getDay()<10?"0"+newDate.getDay():newDate.getDay(); var hours=newDate.getHours()<10?"0"+newDate.getHours():newDate.getHours(); var minuts=newDate.getMinutes()<10?"0"+newDate.getMinutes():newDate.getMinutes(); var seconds=newDate.getSeconds()<10?"0"+newDate.getSeconds():newDate.getSeconds(); document.write(year+"-"+month+"-"+day+" "+hours+":"+minuts+":"+seconds); 显示结果:2016-07-01 15:21:39 var newDate = new Date(); $scope.dateStr =newDate.getFullYear() + "-" + ((newDate.getMonth() + 1) < 10 ? "0" : "") + (newDate.getMonth() + 1) + "-" + (newDate.getDate() < 10 ? "0" : "") + newDate.getDate(); $scope.nowNewDate = new Date($scope.dateStr.replace(/-/g, '/')); -- 标准时间 var beginDate = Date.parse($cookies.get('newBeginTime')); -- 时间戳 var beginDateStamp = new Date(beginDate); -- 2016-11-11 $scope.beginDate = beginDateStamp.getFullYear() + "-" + ((beginDateStamp.getMonth() + 1) < 10 ? "0" : "") + (beginDateStamp.getMonth() + 1) + "-" + (beginDateStamp.getDate() < 10 ? "0" : "") + beginDateStamp.getDate();