How to Get Current Date and Time in AngularJS?

By Hardik Savani October 20, 2023 Category : Angular

In this example, we will learn how to get current date time in angular js application. we can get current date and time with specific format like yyyy-mm-dd, dd/mm/yyyy, mm-dd-yyyy hh:mm:ss etc. we will display current date and time using angular js ng-bind directive.

You can see bellow example we use Date object for getting current date and time. So you can see bellow syntax, example, full example and also output bellow. let's see it and i hope it will help you.


{{ 'Date Object' | date: 'Date Format' }}


{{ CurrentDate | date: 'dd/MM/yyyy' }}


<!doctype html>



<title>How to get Current Date and Time in AngularJS? -</title>

<script src=""></script>


<body ng-app='myapp'>

<div ng-controller="myCtrl">

<p>{{ CurrentDate | date:'dd/MM/yyyy'}}</p>

<p>{{ CurrentDate | date:'MM/dd/yyyy'}}</p>

<p>{{ CurrentDate | date:'dd/MM/yyyy HH:mm:ss'}}</p>



<script type="text/javascript">

var app = angular.module('myapp', []);

app.controller('myCtrl', ['$scope', '$http', function ($scope, $http) {

$scope.CurrentDate = new Date();







02/07/2019 09:23:47

I hope it can help you...