Angularjs 日期格式转换


我自己的随笔,记录我编码的点滴。

<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8"/>
    <link rel="stylesheet" type="text/css" href="reference/bootstrap.css"/>
    <script type="text/javascript" src="reference/angular.min.js"></script>
</head>
<body ng-app="test" ng-controller="testController">
    <h1>tt的结果</h1>
    <h1>{{tt}}</h1>
    <h1>{{tt|date:"yyyy-MM-dd"}}</h1>
    <h1>{{tt|date:"yyyy-MM-dd HH:mm:ss"}}</h1>
    <h1>Date的结果</h1>
    <h1>{{t2}}</h1>
    <h1>{{t2|date:"yyyy-MM-dd"}}</h1>
    <h1>{{t2|date:"yyyy-MM-dd HH:mm:ss"}}</h1>
    <script type="text/javascript">
        var app=angular.module("test",[]);        
        app.controller("testController",function($scope){
            $scope.tt="2016-03-03T00:00:00";
            $scope.t2=new Date();
        });
    </script>
</body>
</html>


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM