Advertisement
folliejester

Date and Time

Mar 5th, 2024
589
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 0.91 KB | Source Code | 0 0
  1. <!-- Displaying Date and Time using AJS -->
  2. <!DOCTYPE html>
  3. <html>
  4.     <head>
  5.         <title>Date and Time</title>
  6.         <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.4/angular.min.js" integrity="sha512-fVCjT4t8Rpwq8H9CRtGl2KJGwJZXJJJ5vamhkpcT8UmW+Oe0ZNC2ACO8/virYei0FynS5nbliWfCPVV4NkBrJA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
  7.     </head>
  8.     <body ng-app='myapp'>
  9.         <div ng-controller = 'myCtrl'>
  10.             <p>{{CurrentDate | date: 'dd/MM/yyyy'}}</p>
  11.             <p>{{CurrentDate | date: 'MM/dd/yyyy'}}</p>
  12.             <p>{{CurrentDate | date: 'MM/dd/yyyy HH:mm:ss'}}</p>
  13.         </div>
  14.     </body>
  15.     <script type="text/javascript">
  16.         var app = angular.module('myapp',[]);
  17.         app.controller('myCtrl',['$scope','$http',function($scope,$http)
  18.         {
  19.             $scope.CurrentDate = new Date();
  20.         }]);
  21.     </script>
  22. </html>
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement