<!DOCTYPE html>
<html ng-app="myApp">
<head>
<meta charset="UTF-8">
<title></title>
<script src="../js/lib/angular/angular.min.js"></script>
</head>
<body ng-controller="my">
<div>
<h3>日期时间过滤器</h3>
<div>
原始输出:<span ng-bind="date"></span>
</div>
<div>
日期格式化:<span ng-bind="date | date"></span>
</div>
<div>
日期格式化:通常情况下,需要按照用户的要求进行输出,这时候就会附带参数
y/M/d/h/m/s/E 年/月/日/时/分/秒/星期
<br />
<span ng-bind="date | date:'yyyy年MM月dd日 hh:mm:ss'"></span><br />
<span ng-bind="date | date:'yyyy年MM月dd日'"></span><br />
<span ng-bind="date | date:'hh:mm:ss'"></span><br />
</div>
</div>
<script type="text/javascript">
var app=angular.module("myApp",[]);
</script>
<html ng-app="myApp">
<head>
<meta charset="UTF-8">
<title></title>
<script src="../js/lib/angular/angular.min.js"></script>
</head>
<body ng-controller="my">
<div>
<h3>日期时间过滤器</h3>
<div>
原始输出:<span ng-bind="date"></span>
</div>
<div>
日期格式化:<span ng-bind="date | date"></span>
</div>
<div>
日期格式化:通常情况下,需要按照用户的要求进行输出,这时候就会附带参数
y/M/d/h/m/s/E 年/月/日/时/分/秒/星期
<br />
<span ng-bind="date | date:'yyyy年MM月dd日 hh:mm:ss'"></span><br />
<span ng-bind="date | date:'yyyy年MM月dd日'"></span><br />
<span ng-bind="date | date:'hh:mm:ss'"></span><br />
</div>
</div>
</body>
<script type="text/javascript">
var app=angular.module("myApp",[]);
app.controller("my",["$scope",function($scope){
$scope.date = new Date();
</script>
</html>