program12

<!DOCTYPE html>

<html lang=”en” ng-app=”dateApp”>

<head>

 <meta charset=”UTF-8″>

 <meta name=”viewport” content=”width=device-width, initial-scale=1.0″>

 <title>AngularJS Date Display</title>

 <script src=”https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/

angular.min.js”></script>

</head>

<body ng-controller=”DateController”>

 <h1>Current Date</h1>

 <p>Default Format: {{ currentDate | date }}</p>

 <p>Short Date Format: {{ currentDate | date:’shortDate’ }}</p>

 <p>Full Date Format: {{ currentDate | date:’fullDate’ }}</p>

 <p>Custom Format: {{ currentDate | date:’yyyy-MM-dd HH:mm:ss’ }}</p>

 <script>var app = angular.module(‘dateApp’, []);

 app.controller(‘DateController’, function($scope, $interval) {

 $scope.currentDate = new Date();

 // Update the date every second

 $interval(function() {

 $scope.currentDate = new Date();

 }, 1000);

 });</script>

</body>

</html>