Angularjs get current date time: You can get current date time in angularjs on Html template and javascript both. Here we have explained both the Html template date time and javascript date time with syntax and example.
Angularjs get current date time
You can get current date time in angularjs as :
Get current date time on Html template in AngularJs :
You can get current date time on html template as below :
Angularjs get current date time Syntax
{{ date_expression | date : format : timezone}} |
Example:
Current date time on html Example
Current Date : {{CurrentDate | date:'dd/MM/yyyy'}} 24 Hrs Current Date Time : {{CurrentDate | date:'HH:mm:ss'}} 12 Hrs Current Date Time : {{CurrentDate | date:'hh:mm:ss a'}} |
Which will give current date time
Get Current Date time in Angular Controller Js
You can get current date time in angularjs as :
Angularjs get current date time on js Syntax
<div ng-app="myApp" ng-controller="MyCtr"> dd/MM/yyyy format - <div ng-bind="date-format-ddMMyyy"></div> dd, MMMM yyyy format - <div ng-bind="date-format-ddMMMMyyyy"></div> 24 Hour time- <div ng-bind="date-format-HHmmss"></div> 12 Hour time- <div ng-bind="date-format-hhmmsstt"></div> </div> |
Note : For date format reference you can go through –Date Format Reference .